Developer

I have been an active web developer since 1999. I am proficient with dozens of languages but specialise in Python and PHP, and in a few different frameworks, namely Drupal and Django. I also enjoy the odd task in MIPS, MATLAB, C, or VHDL when required. I am a strong proponent of open source, web standards, and accessibility.

From the blog:

Dealing with human readable network addresses

Oct 18, 2009

network_expand_range() and network_compact_range() allow the expansion and contraction of IP addresses or ranges as human readable input.

Executing a callback for all files in a directory

Jun 17, 2009

directory_walk allows running an arbitrary callback on all files in a deep directory structure.

Implementing row level access control in CakePHP

May 02, 2009

The ACL Component in CakePHP is very powerful and can be used to solve a wide variety of access control problems. In this tutorial, we provide a step-by-step guide for implementing row level access control to a model.

Creating a community in five minutes with CakePHP

May 01, 2009

CakePHP’s automatic hashing makes things a lot harder than they need to be, and simple tasks (e.g. a registration page) become annoyingly difficult.

Here, we build a complete community based website in five minutes using Cake best practices, with the following features:

  • Account registration
  • Login and logout
  • Account management page
  • Password retrieval

Repository content moved to the blog

Apr 08, 2009

I have just finished moving all of my repository content to separate posts in WordPress. I also decided to get a little tricky and manually imported all of the old comments into WordPress too.

Better Error Handling with CakePHP

Apr 06, 2009

CakePHP is a wonderful framework, but it really drops the ball when it comes to practical error management. In production environments (DEBUG = 0), only 404 or 500 errors are displayed to the user, and no errors are written to the log files.

To solve these two problems we override php’s error handler to enable production error logging, and cake’s error handler to allow forward facing error pages.

Viewing binary data as a hexdump in PHP

Apr 05, 2004

hexdump() allows you to dump a binary data stream into a human-friendly format.

Searching for files in the include_path

Apr 05, 2004

file_exists_incpath() checks whether a file exists anywhere along your include_path.