Nomadic cattle rustler and inventor of the electric lasso.
Company Website
Follow me on twitter
Contact me for frontend answers.

React hexagon component

06 September, 2018

I am writing this because I could not find anything adequate in my interweb searches for how to draw a hexagon using a svg polygon What I…

Narrowing a union type in typescript and a gotcha with callbacks

31 August, 2018

Narrowing a union type In typescript, a union type describes a value that can be one of several types separated by the vertical bar, for…

Higher Kinded Types in typescript

14 April, 2018

Higher kinded types are not currently possible in typescript but let us start by explaining why they exist. In functional programming there…

Creating an accessible react website

05 November, 2017

I’ve recently been working on an online application form in the form of a multistep wizard that had strict accessibility requirements. I’ve…

Instance Reducers

20 December, 2016

I recently came across a situation with redux that I had not considered before. I had created an autocomplete component that was using…

Streams and Async Await in Nodejs

10 September, 2016

Dealing with asynchronicity in nodejs has been a challenge from day one due to its non blocking nature. The evolution has been slow and the…

Animated 3D Pyramid with CSS3 and SASS

28 June, 2016

Below is the end result of this post or you can see a live demo here . This will not work for IE11 or before. The sass/css of this post…

Animating Paths and Arcs with d3.js

12 June, 2016

You can see a working example of the end result of this post here and above is a screenshot. The full and current source can be found…

Animating a sine wave with d3.js and MathJax

25 May, 2016

Below is an animated gif of the end result of this post or you can see the real page here . The full and current source can be found here…

Tangent to a Curve on mousemove with d3.js and math.js

26 January, 2016

Following on from my last post on axes positioning, I have added the functionality to add a tangent to the curve on . You can see a…

Negative Axes and Axes positioning with d3.js

16 January, 2016

Up until now when I have been dealing with d3.js’s axes components, I have always kept the axes positive, i.e. both the x and y axes…

Resize to scale with d3.js

16 November, 2015

I am available for work right now, if you are interested then email me directly. Following on from my last two posts, Perpendicular…

Perpendicular bisectors of a triangle with d3.js

31 October, 2015

Following up from my last post on how to draw the altitude of a side of a triangle through a vertex, I wanted to draw the 3 perpendicular…

Altitude of a triangle with d3.js

24 October, 2015

I’m back at college learning the maths that I should have learned a long time ago. I am also trying to kill 2 birds with one stone by using…

Grid lines and the equation of a line with d3.js

20 September, 2015

I’ve recently gone back to college to do a higher maths class at night and I want to use some of the concepts I am learning in my…

Emberjs - Detail view without switching routes

02 September, 2015

Rendering long lists of tabular data on the client is something I have spent a lot of time on and this dates back to my backbone days. You…

Functional JavaScript in the browser and why I should care

01 July, 2015

Why should you care about functional javascript? I’d heard of the merits of functional programming for a while now and up until recently, I…

Clojure - idiomatic refactor from recursion

17 June, 2015

I’ve become addicted to solving programming challenges that you might find at hackerrank or 4clojure . I spend most of my day job in…

Emberjs - Computed Properties and Promises.....don't

10 June, 2015

A question I see coming up time and time again is how to return a resolved promise from a computed property. There are a number of ways of…

Emberjs - Avoiding Side Effects....or at least trying

21 May, 2015

I’ve been using ember for 2+ years and the more I deal with a single page application that exists in memory for an indeterminate length of…

Emberjs - Observers the Root of all Evil

07 April, 2015

Observers Are Like Crack Cocaine only more destructive… After 2+ years of working on the same emberjs application, I have learned the hard…

Emberjs, reflux, immutability, no ember data, no models....sanity?

13 March, 2015

Where we are In my last here , I put forth the argument that the new data flow story of ember next does not go far enough. I now want to…

ember.js - Data down, actions up...better but still not far enough

12 February, 2015

The Ghost of Christmas Present It is ironic that the thing that first drew me to ember is the thing that ended up causing the most…

Fast Prime Number Generation in Clojure

07 February, 2015

I’ve tried to stay away from building anything meaningful while I have been learning clojure and instead I have been solving problems on the…

Connected Graph with Clojure

28 January, 2015

I’ve fallen in love with clojure and as part of my learning, I’ve set myself the goal of solving all the problems on the excellent 4clojure…

Clojurescript - Handling Mouse Events With core.async

30 December, 2014

I came across a situation recently where I needed to know the and co-ordinates of the mouse while the user was dragging over a canvas…

Clojurescript - Using Transducers To Transform Native Javascript Arrays

13 December, 2014

I’ve been digging into clojurescript more and more but as I am still quite new to cljs, I find myself over zealously calling the clj->js…

Ember.js - Rendering Dynamic Content

18 November, 2014

Warning: The examples use Ember 1.7.1 I’m not going to go into great detail in this post as I think the code examples will be out of date…

Clojure - lazy Sequences for the Masses

08 September, 2014

I have recently fallen head over heals in love with clojure and I’ve decided to run through the problems in the excellent 4Clojure site to…

Partial Functions with bind

05 March, 2014

I gave a talk last night at the local Glasgow JavaScript user’s group and I was a little surprised that not everybody had heard of the…

ES6 Generators - Synchronous Looking Asynchronous Code

01 March, 2014

In my opinion, the most challenging thing about programming JavaScript in the browser is having to deal with asynchronicity. As developers…

Ember.js - Calling a handlebars helper from another handlebars helper

07 April, 2013

If you ever have wondered how to call a handlebars helper from another handlebars helper but were unsure how to, then fret no more. In…

Ruby, RabbitMQ RPC and WebSockets

10 April, 2012

Scenario The rails project that I am currently working on presented an interesting problem which I am guessing is a reasonably common one…

Unit Testing Ember.js, How I Learned to Stop Worrying and Love the Runloop

03 April, 2012

I am currently using Ember.js for a side project and I have ran into some interesting and unexpected behaviour while driving the…

Backbone.js - Lessons Learned

13 November, 2011

I have been using Backbone.js for a few months now and I have found the learning curve to be a steep one. As is the case with any…