Generate overridable getters and setters in Javascript

Javascript has given you the ability to define properties on objects for a while now, utilising Object.defineProperty to control how properties are read and written. In this post I will detail how to make getters and setters which can be overridde...

How to capture email addresses using Analytics

For an upcoming project of mine - learnchinesegym.com - I wanted a ‘soon-to-be-launched’ page with a simple sign up form through which users could submit their email addresses in order to be notified of updates. Typically, unless one already has t...

How to check if a JPEG is progressive

I’m trying to optimise my JPEGs so that they’re progressive. That way they will appear to load quicker for visitors to my website. This practise seems to be gaining steam recently. In fact, remember in the late 90’s when computers and internet spe...

How to wrap fs.exists() within a Promise

I have started using the Q module - an implementation of the Promises specification. One nifty function it provides is denodify. This makes it easy to convert a Node.js function (which takes a normal callback) into one which returns a Promise. All...