Writing

Below is a list of all posts from this site.

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.

December 22, 2022
Creating pull requests with GPT3 and random artwork

Using OpenAI and some simple scripting to generate artful pull requests

November 12, 2022
Git
New project: Food price scraper

A Git scraper that tracks Ocado product prices.

November 11, 2022
OpenAI Git poetry

Using GPT3 to generate poems from your Git history.

October 30, 2022
"It was the system. We can't change it."

A memorable dialogue from David Mitchell’s 2014 book.

June 29, 2022
Auditing 1Password activity

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

June 08, 2022
Flakey tests in a large Python/Django codebase

A list of test anti-patterns that lead to flakiness.

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 19, 2020
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.

March 05, 2020
git
Resolving conflicts during a Git rebase

Some collected tips from over the years.

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 18, 2019
Beware of changing the 'related name' of a Django model field

It can generate unnecessary database operations.

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.

November 07, 2017
Little-known words relevant to software development

A curated collection of words-of-the-day.

October 16, 2017
Using a custom Sentry client

A Sentry tip from the Octopus Energy tech blog.

October 04, 2017
Why your Django models are fat

A tongue-in-cheek list.

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.

April 10, 2017
Podcast.__init__ on Oscar

A podcast on django-oscar.

March 27, 2017
Reorganising a Consul key-value store

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

March 21, 2017
Lies you're told on a software project

Programmers lie constantly.

March 16, 2017
Hugo

Migrating a Django site to Hugo.

May 05, 2016
Django, ELB health checks and continuous delivery

A post on the Octopus Energy tech blog

January 21, 2016
Testing for missing migrations in Django

A post on the new Octopus Energy tech blog

November 23, 2015
Octopus Energy

A modern, high-tech energy supplier

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

April 04, 2015
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

May 01, 2014
The road to Oscar 1.0

A plan for 2014

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

July 09, 2013
purl, URI templates and generated tests

Matching the RFC using Nose’s test generators

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

December 14, 2012
Mathematics and engineering

A pithy footnote from SICP

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

Allowing external parties to sFTP securely

September 09, 2012
September 02, 2012
Cacheback - asynchronous cache refreshing for Django

A simple caching library that uses Celery to refresh stage cache items

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 19, 2012
purl - immutable URL objects for Python

An immutable URL class designed for easy inspection and manipulation

April 12, 2012
Embedding HTML in Django messages

Using ’extra_tags’ to flag up HTML-safe messages

April 01, 2012
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 03, 2012
Confoo 2012 presentations

Two talks from the Python stream

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 13, 2012
Introducing unittest-xml: testing XML in Python

A simple module for making XPath assertions

January 06, 2012
Rewriting codeinthehole.com

Yet another RST blog

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
May 22, 2011
Multi-scp: copying a file to all hosts in your SSH config

Using node.js to copy a file to multiple remote hosts

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

Providing simple coloured feedback

March 13, 2011
Domain-model-mapper - A PHP Data Mapper implementation

A lightweight implementation of the Data Mapper for PHP 5.3

March 12, 2011
Commandlinefu presentation at Confoo 2011

Link to slides available here

February 04, 2011
November 10, 2010
nurl - an immutable URL object for node.js

A URL value object for node.js

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

July 09, 2009
A pseudo-code job advert and its discontents

A cringe-worth and divisive recruitment technique

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

April 15, 2009
Ingenious use of an anonymous function

An element Lambda employment

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 22, 2009
Current pet project: Command-Line-Fu

Creating a site for sharing commands

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

December 06, 2008
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

November 10, 2005
Writing a Thesis in LaTeX

A short guide to getting things to look nice

February 01, 2005
Tutorial: the complex Ginzburg-Landau equation

An introduction to this well-known equation.