About Me

Curriculum Vitae

A brief list of my current skill set


Libxmljs Update on CentOS 3.8 throws an SELinux Wobbley Fit
Monday, 20th August 2012, 15:40

The right way to fix this sort of issue

TV Land Doesn't Understand Technology
Friday, 17th August 2012, 17:09

Or maybe it does and thinks we don't?

Yet More Benchmarking - Function Chains vs Object Chains
Wednesday, 15th August 2012, 13:34

Working towards a faster Node.js framework

More Benchmarking in Node.js and V8
Tuesday, 14th August 2012, 12:19

Working out the fastest way to route

MinnaHTML.js Benchmarking for Speed in Node.js
Monday, 13th August 2012, 17:55

Don't believe it, test it

Playing Around With HTML5's Canvas
Friday, 10th August 2012, 16:19

Speccy loading screens in a browser!

Scripting in Node.js AKA How to Watch for Olympic Tickets Using a Script
Tuesday, 7th August 2012, 23:37

Let Node refresh the webpage so you don't have to!

A Javascript Confirm/Alert Replacement jQuery Plugin
Monday, 6th August 2012, 23:06

Much prettier than the horrible alert and confirm dialogs

A Few Node.js Essential Modules
Friday, 3rd August 2012, 14:40

As essential as they can be anyway

Retro Coding Corner: Loading ZX Spectrum Snapshots off Microdrives - Part 2
Tuesday, 31st July 2012, 18:20

It's like juggling 8 balls with one hand behind your back

One Layout To Rule Them All
Monday, 30th July 2012, 16:03

Designing a layout to fit every screen

Retro Coding Corner: Loading ZX Spectrum Snapshots off Microdrives - Part 1
Thursday, 26th July 2012, 16:57

From emulation to super fast tape

Upgrading Libxml2 on CentOS 5.8 fixes Libxmljs
Wednesday, 25th July 2012, 11:33

Fixes strange compile errors and everyfin

Installing Node.js 0.8.x under CentOS 5.8
Tuesday, 24th July 2012, 14:13

It's just an upgrade of Python away

Node.js and Object Oriented Programming
Sunday, 22nd July 2012, 23:46

Make pages inherit pages

Projects and Sillyness

MAME Cabinet Diary

How I built my own arcade cabinet

Loading Screen Simulator

I don't miss the ZX Spectrum, I still use it!

The Little Guy Chat Room

It's a Pitfall inspired chat room


A fully featured MP3 player what I wrote

GP Space Invaders

My first little emulator

GP32 Development Page

Some info and links about this cute little handheld

Disney Nasties

Uncensored images, you must be 18 to view them

Diary of a Hamster

Learn about how hamsters think, first hand


Time Calculator

A simple little online utility for working out how many hours to bill a client

A Few Links

A Few Node.js Essential Modules
Friday, 3rd August 2012, 14:40

Actually, I take that title back, I don't believe any Node.js module is essential. And I'm beginning to worry about how the whole development side of things is being taken over by people obsessed with frameworks that are entirely about making Node apps easy to develop, whilst doing their best to destroy all the beauty and speed of Node.js in the first place.

If this is you, please leave Node alone and go get a job at Microsoft.

You know I'm even thinking seriously of creating my own replacement for Connect (a framework I actually like) which tries to re-address the balance between usability and speed. But that is a job for next week, until then, here are a few modules which you should check out.


If you develop with Node, you will spend an awful lot of time looking at a console terminal, and console.log lines can get very busy down there. The solution to making it more readable is Coloured, and even spelt properly too!

How it works is cute, it extends the String object, adding functions which insert all the correct control codes for adding colour and style to terminal logs. You can also choose not to extend the String object if you wish, and extend either a different object or no object at all and just use it as a function.

So you can either do it this way (my preferred option):

var colour = require("coloured");


console.log("Error: ".red().bold() + "Something Bad Happened!".yellow());

Or you can do:

var colour = require("coloured");

console.log(colour.colourise("Bad Things are Happening :(", { foreground: "red", background: "white", extra: "bold" }));

There are two shorter ways:

var colour = require("coloured");

console.log(colour.colour("Error Error Will Robinson", "red"));


var colour = require("coloured");

console.log(colour.extra("I'm Feeling Quite Strong", "bold"));

Using this sure does make things easier to see in the console, especially if you spam different debug messages in different colours. You can quickly spot the things you are most interested in seeing.


Perhaps this shouldn't need any introduction, it is a must for anyone who works with Cascading Style Sheets, which lets face it is going to be 99.999% of web developers. It pretty much cures everything that is annoying about CSS without losing any compatibility with CSS. In much the same way CoffeeScript is a bad idea, Less is a good one. It gives you variables, macros, nesting and includes, and the result is compiled into valid CSS.

Quick example:

@base-font-size: 1.1em;

font-size: @base-font-size;

font-size: @base-font-size + 0.2em;

I'm sure you can guess the rest, more examples on the website. This module is best used as an automated way of compiling your CSS at the server, it has the added benefit of compressing it a bit too, always a good thing.


Another important tool is UglifyJS, which sounds a lot harsher than it is. Basically this is the all important Javascript compressor, a must have for delivering mini-fied .js files to the client.

var ugly_pars = require("uglify-js").parser;
var ugly_proc = require("uglify-js").uglify;

var orig_code = "Javascript code to send to the client";

var ast = ugly_pars.parse(orig_code);
ast = ugly_proc.ast_mangle(ast);
ast = ugly_proc.ast_squeeze(ast);

var minified_code = ugly_proc.gen_code(ast);

Much like Less above, this is best used in automated methods for compiling client side Javascript. Note that Connect actually has modules which will integrate both UglifyJS and Less together, delivering compressed CSS/JS without much effort on your behalf.


Many a website needs to send an email, and I've been using reliably Nodemailer for some time with no issues. It has just the right combination of ease and functionality. If you need to send mails, then this is a great module to start with.

An example should explain all:

var email = require("nodemailer");

email.SMTP = {
host: "mymail.server.com",
port: 25,

sender: "from@whenceitcame.com",
to: "some@address.com",
subject: "Thank You!",
body: "Just to say thanks for your comment!\n"

function(error, success) {
if (error)

I like how the configuration is separate from the email sending, gives you options, and it's always good to have options. For the record, it does support HTML, SSL/STARTTLS, connection pooling, attachments, and much more.


Finally, processing uploaded images, or making dynamic ones, is often nicely achieved with ImageMagick, so what better way to manipulate them on the server than with Node-imagemagick? Ideal for making thumbnails, etc.

Again a quick example:

var magick = require("imagemagick");

magick.convert([strSourcePath, "-trim", "-resize", "75x75^", "-gravity", "center", "-extent", "75x75", "-quality", "65%", strDestThumbPath], function(err, metadata) {
if (err)

These are not the only modules I use, I dabble with others, however hopefully they fill basic gaps for someone new to Node.js who wants to know where to start, without having a "This is how you write Node Apps" philosophy thrust upon them by someone who thinks any such thing is set in stone.


Add Your Own Comment