Tips

Most of my writing is a catalogue of tips - things that I have found useful.

October 06, 2024
An LLM TDD loop

Using llm and files-to-prompt to run a TDD loop.

June 06, 2023
Writing Markdown in Vim

A reference of how I have things configured.

January 06, 2023
Tips for using Github Copilot in Vim

Two recommendations for using Copilot effectively.

June 29, 2022
Auditing 1Password activity

A few how-to guides on auditing 1Password team accounts.

October 14, 2021
Explaining

Record your explanations somewhere permanent.

May 03, 2021
Vim
Vim's useful lists

A reference post of Vim’s lists and tips on using them effectively.

November 16, 2020
Vim
A Vim mapping for opening virtualenv files

A useful cnoremap for Python development.

July 14, 2020
Conditional nested blocks in Terraform

Using dynamic blocks to implement a maintenance mode.

July 08, 2020
Maintainable Terraform CIDR lists

HCL allows comments, which is useful.

June 23, 2020
Easy Github URLs from Vim

A super-useful Vim mapping for grabbing Github URLs.

April 24, 2020
Software development tips – part 2

Topics: code smells, pop-culture, blogging and work habits.

February 26, 2020
Software development tips – part 1

Topics: development, tools and effective teams.

June 13, 2019
Vim text-objects for Python development

The nouns of your Vim thought stream.

March 28, 2019
vim
Debugging Vim by example

A series of short stories.

March 08, 2019
vim
Using black and isort with Vim

The simplest way to run both in a project.

March 06, 2019
February 21, 2019
Installing the latest RabbitMQ on Ubuntu 18.04

Write-up of a painful morning.

December 24, 2018
Easy to change

The overarching principle for writing maintainable code.

October 27, 2018
Listing groups in G-Suite

Using the API to pull simple reports.

June 03, 2018
Advanced pull-request crafting

Working notes based on reviewing several thousand pull requests.

November 27, 2017
Shortcuts of the old and minimalist

Some quick ways to hide the clutter.

November 16, 2017
Joining between date and timestamp fields in Postgres

A note-to-self on avoiding DST issues when joining between tables.

September 30, 2017
Bash error reporting

Two tips for better debugging of Bash scripts.

August 29, 2017
Using pgbadger with AWS RDS

Two gotchas that I wasted time on.

August 26, 2017
A mnemonic for mock decorators

An easy way to remember the order arguments get injected.

June 30, 2017
Your codebase is your house

A useful metaphor for the maintainability of a codebase.

June 06, 2017
git, jq
Git tips for working with pull requests

Using the Github API to quickly jump to a PR detail page.

May 16, 2017
Converting JSON into CSV data for Google Sheets

Another note-to-self on how to use JQ.

March 27, 2017
Reorganising a Consul key-value store

This is really just a reference on how to combine JQ’s select filters.

October 02, 2015
git
A useful template for commit messages

A simple heuristic for preferring the imperative mood

September 02, 2015
Copying Postgres output into a spreadsheet

Quick tip on tweaking the output of psql

May 02, 2015
aws
An SSH tip for modern AWS patrons

Slightly useful tip for SSHing onto EC2 instances

March 19, 2015
Backing up Postgres database rows before deleting them

Quick tip on avoiding accidental data loss

January 31, 2015
Avoiding clashing Django migrations

A simple Travis test to avoid frustration

October 24, 2014
Bootstrapped virtualenvs

Using postmkvirtualenv to prime postactivate

October 22, 2014
Integrating Django application metrics into Zabbix

A simple how-to for feeding Django metrics into Zabbix

July 17, 2014
Linking to Github

Git aliases for grabbing Github links

June 18, 2014
Continuously rebuild your project

Using CI to avoid pain for new team members

June 17, 2014
vim
Using the silver searcher with Vim

Lightning-fast :grep searching in Vim

January 16, 2014
Command-line tips for effective release announcements

Git tips for writing release notes

October 04, 2013
August 08, 2013
git
Enhancing your Git commit editor

Commit message pedantry taken to a new level

July 28, 2013
Dumping and restoring a PostGIS database

Harder than it should be

June 12, 2013
A deferred logging file handler for Django

Using a setting to control where file logs go

June 01, 2013
Conditional logic in Django forms

Radio buttons can be tamed

May 03, 2013
PyPI README badges

Shiny badges using crate.io

April 23, 2013
April 22, 2013
Disable database access when writing unit tests in Django

A decorator for the testing puritan

April 18, 2013
How to install PIL on 64-bit Ubuntu 12.04

Because I have to look this up every time

March 04, 2013
git
Converting Github issues into pull requests

A better workflow using Hub

February 19, 2013
Altering Postgres table columns with South

Using ‘USING’ to cast correctly

January 14, 2013
Configuring logging for Postgres.app

The recommended way of debugging SQL problems

October 20, 2012
October 16, 2012
How to chroot a user in Ubuntu 12.04

Allowing external parties to sFTP securely

September 09, 2012
July 19, 2012
Use models for uploads

Using models for audit and clarity

July 06, 2012
Vim macros for adding i18n support to Django templates

Using macros to automate the boring stuff

June 16, 2012
A data migration for every Django project

No more embarrassing emails from example.com

May 05, 2012
Django, Nginx, WSGI and encoded slashes

Encoded slashes have a hard time getting through to Django

April 12, 2012
Embedding HTML in Django messages

Using ’extra_tags’ to flag up HTML-safe messages

March 21, 2012
How to reload Django's URL config

A rare sighting of the ‘reload’ function in the wild

March 13, 2012
Validating international postcodes in Django

Using dynamic imports to leverage Django’s localflavor

March 11, 2012
How to sync PyCon videos to your iPhone

Using Python to fetch and convert YouTube videos for syncing to iPhone

March 05, 2012
git
Tips for using a git pre-commit hook

Yet another git tips article

March 01, 2012
Testing HTTPS handling in Django

Spoofing a HTTPS request using the Django test client

February 25, 2012
Prefer data migrations to initial data

South provides a better way

February 09, 2012
A Fabric function for git tagging

Using Fabric with git-flow

February 02, 2012
Solving MySQL connection problems caused by a dead name server

MySQL’s DNS lookups can cause serious problems

January 23, 2012
January 05, 2012
How to set-up MySQL for Python on Ubuntu

This doesn’t stick in my head

August 20, 2011
August 16, 2011
Console logging to STDOUT in Django

Undocumented option required to avoid STDERR

August 11, 2011
April 20, 2011
Coloured output while doing TDD with Django and Fabric

Providing simple coloured feedback

November 05, 2010
mysqldump with wildcard table matching

Using the fu to enhance mysqldump

September 03, 2010
August 22, 2010
Phing trick for avoiding deploying debug code

Using the fu with with phing to prevent further embarassments

January 28, 2010
php
Return false with prudence

Returning false to indicate an error is wrong

October 13, 2009
Javascript refactoring for customising shared libraries

Structuring a javascript file for repeating use and customisation

May 31, 2009
Deploying cron jobs using Phing

A phing pattern for deploying cron scripts

May 25, 2009
Auto-generating an FAQ with Prototype

A lazy way of generating an FAQ

May 24, 2009
Inspecting Javascript objects

Simple introspection methods

May 06, 2009
Phing, Xinc and Nabaztags

Using Phing to command a Nabaztag

March 15, 2009
Using a Phing filter to flush browser caches

Using a filterchain to set a cache-busting query parameter

February 03, 2009
January 11, 2009
January 10, 2009
Phing task to update Twitter status

Simple PHP extension to Phing for Tweeting

January 04, 2009
Deploying to a shared hosting environment using Phing

Using Phing’s FtpDeployTask to good effect

December 14, 2008
Monitoring MySQL with Ganglia and gmetric

A simple bash script for pushing MySQL stats in Ganglia

November 23, 2008
Checking all MySQL tables

Using the commandline to build a string of CHECK commands

November 08, 2008
Javascript cookie objects using Prototype and JSON

Simple class-based wrapper to using cookies

November 07, 2008
Date conditional redirects with mod_rewrite

Using mod_rewrite to redirect based on the date

October 31, 2008
PHP
Creating large XML files with PHP

Using PHP’s DomDocument to create large XML files

October 26, 2008
Monitoring MySQL

watching mysqladmin ftw

October 22, 2008
Following log files with tail -f

Simple trick to watch progressive updates to a file