Trust the typescript compiler

16 March, 2022

I have been using typescript for some time, and I’ve repeatedly got one particular error that I have not taken the time to understand until…

SCRUM is becoming irrelevant

10 August, 2021

Many of us have gone to the gym, and initially, we have obtained good results. Once your body has adapted, the same routine may help you…

The good, the bad and the ugly of React hooks

08 May, 2021

Hooks burst onto the scene in React 16.8 with the lofty goal of changing the way we write React components. The dust has settled, and hooks…

Javascript generators, the superior async...await

03 April, 2021

One of the biggest challenges in writing frontend code or nodejs code is dealing with asynchronicity. There was an original generator…

Boost your productivity with typescript project references

13 March, 2021

If you have a typescript codebase in a monorepo that is not using typescript project references then you are missing a trick. Typescript…

Make any SVG responsive with this React component.

10 January, 2021

If you are putting out digital content onto the world wide web to publicise your work, then there is a high chance that your audience will…

Developer frustrations for 2020

23 December, 2020

Disclaimer The post is tongue in cheek and meant to be a light hearted poke at current developmet. Please do not take this post too…

Put your bundle on a diet with rollup

21 September, 2020

TLDR; Where do we want to get to? The code below is bundled with rollup. Rollup has determined the bare minimum of imports the code needs…

async await is the wrong abstraction

17 May, 2020

There is no denying that the pattern is super simple and has simplified asynchronous programming for developers more akin to server-side…

The Single page Application must die

08 March, 2020

Disclaimer The views here are very much my own and not the opinions of Logrocket. A further disclaimer is that I have spent the last ten…

Code splitting react components with typescript and NO babel

07 March, 2020

The secret to web performance is less code. With the advent of the now-infamous single page application, extreme amounts of javascript…

Real world azure resource management with terraform and Docker

07 February, 2020

Before I start, I would like to thank Iain Hunter for some valuable tips into real-world terraform. If you are using one of the major cloud…

Act now to make your react website accessible.

17 January, 2020

I initially wrote this post at logrocket. The word has not got out, and accessibility is often an addendum to months or even years of web…

Is typescript worth it?

05 January, 2020

I initially wrote this post at logrocket. Before I start, I would like the jury to know that I am, for the most part, a typescript fan. It…

Automation testing is broke and here is why

10 November, 2019

I originally wrote this post at logrocket. Before I start, I want to point out that I am not referring to one particular project or any…

Solutions to Frustrations with React Hooks.

26 October, 2019

I originally wrote this post at logrocket. One of my previous posts Frustrations with React Hooks got an incredible amount of views and…

Frustrations with React Hooks

17 August, 2019

What problems do Hooks solve? I originally wrote this post at logrocket. Before I detail my current frustrations with Hooks, I do want to…

Cypress.io the selenium killer

20 July, 2019

I originally wrote this post at logrocket. Before I start, I want to emphasise that this post is not about one particular project or any…

Bottom and Top types in typescript

22 June, 2019

The concept of a bottom type and a top type is a construct that exists in mathematical type theory and exists in many programming languages…

from tslint to eslint.....all the things...eslintrc, webpack, cmd line and vscode

07 May, 2019

Why?? Long and the short of it is, tslint is on the way out which is really great as tslint has always felt like a very poor man’s eslint…

const assertions in typescript 3.4

27 April, 2019

Typescript 3.4 is out and while I aways find the official typescript docs very informative, they always feel a little bit too academic and a…

Code splitting with typescript, webpack and React lazy

15 March, 2019

I am writing this because everytime I have to set up code splitting with typescript, webpack and React, I forget how I did it last time and…

A journey to svg responsive enlightment, a.k.a. yet another post about the viewBox

09 March, 2019

The svg viewBox is a mysterious and confusing attribute that holds the key to responsive svg documents. On a recent contract, I acquired a…

typescript - excess property checks and return type widening

03 March, 2019

The title of this post would not have meant anything to me 24 hours ago until I came across a scenario that I am surprised I have not come…

React hooks and closures, there may be dragons

09 February, 2019

WARNING, THIS CONTAINS REAL CODE, NO COUNTERS WHERE HARMED IN ORDER TO CREATE THIS POST, REPEAT NO COUNTERS ARE IN THE CODE EXAMPLES. YOU…

Down the rabbit hole with typescript's mapped and lookup types

14 December, 2018

Two of the more abstract concepts in typescript are mapped types and lookup types. Mapped Types Mapped types provide a mechanism to create…

Scaling an SVG element while maintaining the center

24 November, 2018

Following on from my last post on affine matrices I want to go further into what is required to scale svg elements and maintain their centre…

SVG transformations with affine matrices

25 September, 2018

I recently had a requirement to add zooming and panning to an svg image. Panning and zooming are popular interaction techniques which let…

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 can…

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 here…

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 working…

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 where…

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 and as…

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 post 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 and…

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 bind…

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 development…

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 flexible…