Will Hackett

idiosyncratic.

Page 2


Roll your own Platform as a Service

About three weeks ago, I decided it was time for my static GitHub Page website to become an actual Ghost blog running on good ol’ Heroku!

For those of you who are new to Platform as a Service and haven’t heard of Heroku, it’s is a great way to deploy your application to a public endpoint very quickly without all the infrastructure headaches—which we honestly won’t be avoiding in this post, sorry.

A very good point to note about Heroku is that your application needs to make use of environment variables and should be built for service-oriented architecture. Ghost, normally, utilises local storage for both its database (SQLite) and site assets (images, attachments, etc). I follow the 12 factor application methodology.

 12-factor App Methodology

Basically, the 12-factor app methodology a guide for building software-as-a-service applications that use declarative methods for setup...

Continue reading →


Outlaw techno phsychob****—a tale of a pre-relationship agreement

Purely comedy—completely unrelated to my usual ramblings.

Let’s all agree, we’ve had that one relationship. The one where they cannot relate to logic. The one where the past is brought up to fight an argument in the present. The one where every single thing you say WILL be held against you in the kitchen. And, the one that forces you to meet the parents after about three hours of dating.

Protect yourself in the future with this complete “Pre-relationship agreement”. (Free of charge)

Disclaimer: I normally write intelligent articles about software & business that should be taken seriously. Please don’t take this article seriously. If you feel the urge to have a vegan-cross-fit-rabit-cooker meltdown, please try reading alternate texts like ‘The Holy Bible’ and ‘The Secret’ which probably be available in a book store near you. Bits of this article have been appropriated from “Nice Guys...

Continue reading →


Annoyances with Apple’s CDN

CDNs are complex things. A number of factors come together to deliver content in the most effective way, to the end user; but there’s loads of things that can do wrong when it’s not correctly implemented or understood.

If you’ve ever used Apple Music and Spotify, you’ll know very well that Apple has serious performance issues with media playback in comparison to Spotify, and there are good reasons for why.

 Delivery Method

Spotify provides a data-stream of usable content from the get go. By providing a stream, playable media exists immediately and mitigates any lag on playback. Only in extreme circumstances would this process be delayed.
Spotify partial beginning the stream immediately

Apple provides a single m4p file which means that the client (iTunes in this case) needs to wait for enough content to exist before it can play it.

Additionally, these files are usually prepended with meta-data such as album, track and artist...

Continue reading →


Unit testing in Keystone JS

After many annoying tests and messing about with Keystone.JS, I’ve finally managed to get a proper Unit Testing system in place.

 What am I using?

We just need two super useful plugins to get started.

  • Mocha—our test framework will tell us what passes and fails
  • Chai—our assertion library so we can run some tests

 How does it work?

In our package.json we’ve added a test script that sets up Mocha.

"scripts": {
    "start": "node keystone.js",
    "test": "./node_modules/.bin/mocha tests/init.js tests/unit/**"
}

This means that when we run (or in our case, CircleCI runs) npm test we’ll automatically launch into the Mocha test process and work through our assertions.

Our init.js script is simply used to setup the environment and get everything ready that we need to run tests.

process.env.NODE_ENV = process.env.NODE_ENV || 'test';
require('dotenv').load();

var keystone =
...

Continue reading →


Microservices

dockers
Since 2013, I’ve been developing and maintaining the MyClub codebase; a complex system designed to make managing events, club memberships, subscription payments, invoicing and member on-boarding and communication majorly simple for clubs.

MyClub was a PHP web application built on the CodeIgniter framework in its youth. It was accompanied by a MySQL database and lived on its own server. The only service-like component attached was the payment processing component which spoke to Stripe via API, but this all occurred server-side.

Over time, the members increased and the application began to struggle under the sheer load of the requests, so I moved it onto a cluster. Apache would point to a NFS mount-point with the application, uploads and associated requirements for the application to run. Soon began the issues.

When a user uploaded an image, it would move it to the appropriate folder...

Continue reading →


Expedia Viewfinder—a ReactJS application

viewfinder_screenshot-1456990096084.jpg

Viewfinder is a tremendously important project for me as it’s one of the first projects I began at Studio None. Starting at a new firm is daunting, but the team at Studio None are such a perfect mesh that I was up to speed and powering through bug fixes and timesheet avoidance in no-time.

Then, nearly three weeks into the job I, along with Josh Girvin were given this amazing project—Viewfinder.

 What is it?

Viewfinder is a way to significantly expand the application of Expedia’s visual assets beyond the existing city destination guide pages—with the goal of guiding customers from the top of the purchase funnel, to the bottom.

The goal is to make the whole gallery of images available to the customer. Featuring some of the best, high-quality photography from around the world, Viewfinder allows you to discover your next holiday destination through experience and geographical filters.

...

Continue reading →


Multi-node docker deployments with persistent storage

A trait of Docker is that it doesn’t persist state. This is usually great when working with worker applications that don’t need to store and share data, however in the case of databases or even small WordPress instances, persisting state is important.

In this guide, I’ll take a look at how to setup a Docker & Flocker on DigitalOcean infrastructure.

To begin, start by spooling up three Ubuntu 14.04 nodes (you can use the Docker 1.7 template on DigitalOcean to save time installing Docker) and install Docker.

Also, make sure that you have included your local machine’s public key in the setup process for the virtual machines.

 1. Installing Flocker CLI

Flocker’s CLI can run on basically any Unix system, but for the benefits of this review, I’ll only focus on Mac & Ubuntu.

The Flocker CLI will allow you to interact with your cluster’s nodes to manage deployments and migrations. Flocker...

Continue reading →


Docker—a brief introduction

At Studio None, we’ve been using Docker since the beginning of the year and it has massively improved the way we handle our deployments. Docker’s primary objective is to wrap up an application and all its dependencies into a neat little container that can be deployed just about anywhere.

Containerisation isn’t necessarily new, but Docker brings new efficiencies that make sense for development teams making use of continuous deployment. Moreover, Docker makes it easy to scale horizontally and across availability regions.

Understanding how docker works can be easily visualised.

Docker vs Traditional

In many traditional configuration, a single application is bundled up with the operating system and is mounted on a hypervisor. This uses a considerable number of resources from RAM to Disk Space & CPU. Additionally, you must maintain multiple guest operating systems and keep their libraries up-to-date with the...

Continue reading →