Advent of Code 2020

Completed! I finished the Advent of Code for 2020, and this time pushed myself past the holiday indulgences to actually complete all 50 challenges! I pushed myself to use Elixir for everything this year, and barring a few small instances where being able to mutate a value would have saved me a lot of headaches (specifically this evil creation) it was a pretty awesome experience. Aside from the usual 2D grid geometry problems, there were a lot of new things in there and I discovered some nice things on the way.

January 10, 2021

Install referrer testing

Note: The broadcast referral functionality has been deprecated by Google Play and will be removed on March 2020. The new implementation involves connecting directly to the Play Store app - documentation is available at The install referrer is an intent on android, which is broadcast after the app install to give the app information about the reason it was installed. This is useful if you're tracking marketing / paid installs and you want to tell between paid and organic installs.

July 5, 2016

AnkiRB - spaced repetition flashcards made in ruby

In the past few weeks I discovered Omniglot and Anki and thought it'd be pretty cool to be able to create flashcards for the useful phrases listing. Being able to say “this guy pays for everything” in Turkish, or “my hovercraft is full of eels” in Norwegian could be an incredibly useful life skill. And so AnkiRB came into existence. The library basically replicates what the application itself does when you create flashcards via the gui, except uses ruby's sqlite package to create flashcards and bundle media files together.

March 28, 2016

Compiling C with Rakefiles

Make is solid. It's been around since before the internet and still one of the most important tools used today. As such - it's tried, proven, tested, and was used in some of the most successful projects out there. …but what are the chances that something so old got it right the first time? What are the chances that good old Make is the be-all, end-all, perfect ultimate solution for every possible development project?

October 19, 2014

How to write a bug report

Note: This is a post I created for internal distribution when writing bug reports for mobile applications. I'm sharing it here because I think it's useful for future situations. What's a bug report Bug reports exist only to inform people about software defects. They are not for notes, for tracking work done or for planning. There are better systems for this. The best bug reports will have as much appropriate information as possible to help asses get kicked as fast and effectively as possible.

February 17, 2014

CCNode Recursive Description

recusiveDescription is a pretty cool method. It's on each UIView, and when called it gives you a quick and dirty description of the current view hierarchy relative to that view. Usually you'd use this in the debugger, whilst on a breakpoint, to sanity check the positions and children of a view. This is a short gist that adds the same functionality to a CCNode subclass - the common subclass of most visual entities in a Cocos2d project.

February 4, 2014

Ruby Development in the Bar

For reasons I won't get into, I found myself spending Christmas in Wick on the north east tip of Scotland. This being the second time it's occurred I was familiar with the quirks and isolation of this part of the world. One of the more upswinging things that happens is that every 26th December, there's a charity raffle in the local Seaforth Club. This is where you buy some tickets, drink, win prizes and drink some more.

February 2, 2014

Global Game Jam 2014

Last weekend was the Berlin Global Game Jam 2014. I'd made it part of a new years resolution plan to get more involved and release some games / projects, and this represented the first step towards doing something. My awesome team and I worked all weekend making a twin stick style shooter in Unity. This was my first experience with Unity, and as such I spent most of the time watching tutorials and desparately deciphering the mysteries of Unity's component / entity system.

January 30, 2014

Coffeescript + RequireJS Skeleton Project

After being introduced to the awesome pixi.js framework by a colleague, I decided to update an old project of mine to make screwing around with it a little easier. This skeleton project comes with everything you need to run a pretty decent setup, and all at the cost of only two command line options. Skeleton Project! The initial configuration is usually a pain for me, so I threw together an example project and some scripts to manage this.

January 10, 2014

Jekyll Migration Woes

After getting sick of wordpress I decided to do the cool hipster thing and move my blog to Jekyll. Both for the nerd credit and the super awesome minimal design (static site = no moving parts! awesome!). After reading about Josh Kaufman's experience with Jekyll in his book it sounded like a pretty easy and maintainable platform to blog on. However… On the way I encountered a few issues that almost took the chill out of a refreshing Thursday night in Berlin.

July 18, 2013

Optimising CoffeeScript files with r.js - "Unexpected Character"

The Problem… When trying to optimise a coffeescript project with the latest r.js optimiser from the requirejs npm module I ran into the following error: Cannot uglify file: /path/to/main.js. Skipping it. Error is: Unexpected character '' (line: 363, col: 3, pos: 15612) I downloaded the uglify-js package which r.js is using here to minify the script. Running it on the file in question in the output directory of the r.js build process gave me more information - specifically that uglify is dying on the character sequence  - a utf-8 byte order mark.

June 11, 2012

Coffeescript RequireJS and You!

Contents * Auto generated table of contents {:toc} Best friends together at last! So you want to create a javascript application with some kind of non trivial complexity, but separating the functionality out into different script files gets hairy. You need to forward declare certain functions before you execute certain functions, and things need to be loaded before they can be displayed. Then when you add CoffeeScript into the mix you've got a whole new set of problems.

April 24, 2012

Conway's Game of Life in Ruby (gosu + chingu)

inspired by this awesome nds tracker and an old boingboing post, i decided to make an implementation of conway's game of life in ruby, using the gosu and chingu game development gems. after finding a way round the terrible deep cloning in ruby it was incredibly painless and very interesting. i like how the initial choice of cells influences whether you have a beautiful symmetrical oscillating pattern or a horrible cancerous mess, after 100 or so generations.

June 6, 2010

2D OBB Collisions in XNA

OBBs (Oriented Bounding Boxes) allow for a greater degree of accuracy than their axis aligned counterparts in the field of collision detection. It turns out this is a lot simpler to implement in 2D than 3D. Here's my own take on it, which I hope to put to heavy use in an ongoing project. The OBB is modelled by an orientation matrix (in the form of two Vector2's because the Matrix type seems to suck), an origin and a Vector2 representing the +ve half widths in the x and y axis.

March 7, 2010
Nifty tech tag lists from Wouter Beeftink