- Deriving Geographical Coordinates from Map Projections
Given a flat projection of a world map, and an x/y coordinate on that projection, how can we derive the latitude/longitude on the globe?
- Creating tag index pages with Gatsby
I've been giving Gatsby a trial run in this new version of my site. When using GitHub pages, one of the things I'd always longed for was dynamic tag "index" pages for my blog posts.
- Easy VM updates with Ansible
I have a load of VMs running on a physical server in my house. I started with a few VMs and a manual process, but now I have many VMs and I'm tired of updating them all.
- The trading market used for almost every Cities: Skylines interaction
In Cities: Skylines, as your city grows you'll notice people moving around the city - whether on foot, or in a vehicle. They move around for a number of purposes: residents look for jobs and families, tourists visit entertainment centres, and city services such as the fire and police departments will attend calls. There's even a supply chain where logs, coal, goods, etc, both raw and processed, are taken from one business to another (or exported!) as they get refined.
- Building a Super-Robust HTTP API with Isomorphic TypeScript
I've been a fan of TypeScript for a few years now, but it wasn't until I used it isomorphically that I really appreciated how beneficial it can be when it comes to making systems more robust.
- Return Early, Return Often
The cognitive load introduced by having a single return statement in a function (normally accompanied by a
result
variable) is often underappreciated, but luckily with a little refactoring it's fairly easy to resolve. - The Builder Pattern and How It Will Save Your Bacon When Unit Testing
When writing unit tests around classes, often each test will call the constructor for our class and provide dependencies as arguments. However, this introduces some coupling between the tests and the signature of the constructor, which can make it very difficult to change our constructor in future.
- Hassle-free site rebranding with Tailormade
I've worked on a number of projects throughout my lifetime that have had something in common: they're tools used internally in businesses and each business wants the tool rebranded slightly to match their site. In fact, they've got another thing in common: it's always been a major pain to do.
- Tuples vs Interfaces in TypeScript
A tuple is effectively an array with specific types and a specific length. They've been supported in TypeScript since TypeScript 1.3 (it's…
- Unit testing TypeScript with Alsatian
- Dependency Injection for React Components
Dependency Injection, often written as DI, is a great way to ensure your code is as reusable and as clean as possible. The main benefit…
- Global dependencies: they're insecure and they harm your contributors
Global dependencies are everywhere: task managers like Grunt and gulp, test runners such as Karma and ava, transpilers like CoffeeScript and…