Software Development, on the Web

A loosely connected collection of articles on web development, some of which may contain interesting and potentially useful things, some of which may not.

Correctly Handling Timestamp Arithmetic in MySQL

10 April 2013

Working with dates and times in databases, and even software in general, can be tricky. Different timezones and formats to parse are all pitfalls waiting to trip up the unwary engineer. MySQL is a widely used database and in its default configuration ...

Debugging circular module imports in Python with pdb

23 March 2013

I find myself in awe of anyone who can competently use gdb. Occasionally I find myself dipping into it and pulling out some very basic information but that's about my limit. When I saw that Python had a ...

Resolving Javascript Promises using Events

17 June 2012

In playing around with Node.js I wrote a simple ‘view’ module for which I had a particular API in mind. I wanted to be able to pass it a file to instantiate it, set variables on the object and then render it. This was complicated slightly by the ...

Setting up the Graffiti micro web framework

13 March 2011

I like what I’ve seen of Groovy and the Grails framework seems excellent, however it is massive. Sometimes you don’t want a huge framework if you’re just setting up a simple web app. Micro frameworks like Sinatra in Ruby and Express in Javascript for ...

Using Python to delete old files and keep newest ones

30 September 2010

This is a very simple Python script which searches a directory, optionally including a file pattern, and deletes the oldest files.

I hear a lot about Python - it seems to be very popular - so when I needed to automatically delete some old ...