Skip to content

Instantly share code, notes, and snippets.

@paulcuth
paulcuth / 2013-race-1-pit-stops.json
Last active December 15, 2015 03:38
Pit stop times for 2013 Australian Grand Prix in JSON format. Translated automatically from data made public by the FIA [http://www.fia.com/championship/fia-formula-1-world-championship/2013/2013-australian-grand-prix-event-information].
[
{
"driverNumber":5,
"name":"J. BUTTON",
"team":"Vodafone McLaren Mercedes",
"lap":4,
"stop":1,
"duration":22282
},
{
@paulcuth
paulcuth / base64Encode.js
Created November 29, 2011 23:20
JavaScript implementation of base64 encoding.
function base64Encode (data) {
var encoded = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
chars, bin,
output = '',
i;
while (data) {
chars = data.substr (0, 3) + String.fromCharCode (0, 0);
bin = '';
@paulcuth
paulcuth / instanceof.lua
Last active August 12, 2021 12:40
Implementation of instanceof in Lua
function instanceOf (subject, super)
super = tostring(super)
local mt = getmetatable(subject)
while true do
if mt == nil then return false end
if tostring(mt) == super then return true end
mt = getmetatable(mt)
@paulcuth
paulcuth / tfl-tube-data.json
Created July 28, 2011 09:47
TfL tube line & station data in JSON format.
var lines = {
B: 'Bakerloo',
C: 'Central',
D: 'District',
H: 'Hammersmith & Circle',
J: 'Jubilee',
M: 'Metropolitan',
N: 'Northern',
P: 'Piccadilly',