Vanillr Issue Tracker

Last year I started a little side project building an issue tracker called Vanillr. The idea was that it would be super simple, allow multiple projects with multiple users, and hosted at

The need arose from having different projects on the go at the same time and having to collect bug, questions, and feature requests from various sources such as BaseCamp, Skype, and email. I personally needed a place to collect all these and have a more detailed history for each project.

Vanillr Issue Tracker Overview

Below is the selector to filter the importance of the issue and the type of issue too.

Vanillr Issue Tracker Filter

I only got as far as the designs and building the shell until I ran out of time and shelved the project, however I will be refreshing this project in 2014 to get something up and running for myself, and hopefully for others to use too.

23-Jan-2014 at 1:50pm

Similar Posts using the Jaccard Index

Today, I've added a Similar Posts section when viewing an individual post, which is calculated using the Jaccard Index. The Jaccard Index is used to compare the similarity and diversity of data sets, and in my case the data sets are the post tags. The calculation is quite simple:

Jaccard Index

The reason why the Jaccard Index is so well suited for this is because it doesn't just calculate how many tags appear in each post, but instead it calculates this based on the total number of tags in both posts. An example would be that posts matching 4 out of 5 tags would appear higher than posts matching 5 out of 20 tags.

My database structure is pretty typical in the way that I have one table for posts and another for tags, which are linked via the post ID. When viewing a post I already have the set of tags to compare the other posts to, so from these tags I can generate the SQL via:

$tags = array('tag1','tag2','tag3');
$sql = "SELECT `posts`.* FROM `posts`,`tags` WHERE  `posts`.`id` = `tags`.`post_id` AND `tags`.`post_id` != '{CURRENT_ID}' GROUP BY `posts`.`id` ORDER BY SUM(IF(" . implode('||', array_map(create_function('$a', 'return "`tags`.`tag`=\'" . $a . "\'";'), $tags)) . ",1,0))/(COUNT(`tags`.`tag`)+" . count($tags) . ") DESC LIMIT 0,3";

Which will produce the following SQL:

SELECT `posts`.* FROM `posts`,`tags` WHERE `posts`.`id` = `tags`.`post_id` AND `tags`.`post_id` != '{CURRENT_ID}' GROUP BY `posts`.`id` ORDER BY SUM(IF(`tags`.`tag`='tag1'||`tags`.`tag`='tag3'||`tags`.`tag`='tag3',1,0))/(COUNT(`tags`.`tag`)+3) DESC LIMIT 0,3

When this SQL is run it will return the top 3 posts (excluding the current post) in order of the tag similarity score. You can see it in action when viewing any individual post on my blog.

08-Jan-2014 at 4:11pm

Xbox API Twitter Bot

Alan Wynn, who built and maintains the Unofficial Xbox API, gave me full access to his Twitter bot over the weekend after I suggested some improvements to the service.

In its original form you would send a Tweet to the bot in a certain format and it would look up the specified gamertag and reply to the tweet with their current online or offline status.

Xbox API Bot

My suggestion was that if the user is offline then it would continue to check the online status every minute and tweet when the gamer eventually came online. After a complete rebuild, and taking into account multiple requests for a single gamertag, having a 7 day limit to the checks and XboxAPI limit checks, it was complete.

Usage is really simple, just Tweet the following but be sure to replace 'Major Nelson' with any gamertag of your choosing. If it doesn't exist, you'll be notified by a Tweet.

@XboxAPI_Bot isonline Major Nelson

You can fork the code on Github or send a Tweet to see it working in action.

29-Sep-2013 at 5:59pm

Minecraft Skin Preview via PHP

I've expanded on my Minecraft Avatar script I built a while back so that you can now display a skin preview for a given username, like so:

Minecraft Skin Preview

It's as easy as this to use:

<img src='skin.php?u={username}&s={size}' />

Just like the facial avatar, this script grabs their skin from the Minecraft server, and then creates the 4 different views, including facial accessories such as hats or glasses. If the username does not exist, then it uses the default skin, which is stored in a base64 encoded variable to save an extra cURL request.

Check out the code on Github

PHP Blink(1) Class

I've been playing around and having quite a bit of fun with my Blink(1) by ThingM for some time now, and whilst the command line tool is very good, it's somewhat fiddly to send patterns. As a result, I build my own PHP class to interact with the CLI tool.

The example below simply fades to #F68 for 400ms, then fades to #0F1 for 400ms, and then fades to #F68 for 400ms, and this loops 3 times:


You can even go a step further an introduce a flicker effect by adding a quick fade to #000 between each light like so:


The video below demonstrates all the examples as per example.php in the Github Repo

You can view the video on Vimeo or fork the code on Github.

26-Jul-2013 at 12:46pm