Skip to content

Instantly share code, notes, and snippets.

View colingourlay's full-sized avatar

Colin Gourlay colingourlay

View GitHub Profile
[
{
"Ministry":"01. Barton (Protectionist), 1 Jan 1901-24 Sept 1903",
"Title":"Minister for External Affairs",
"Name":"Barton, Edmund",
"House":"HR",
"Party":"Protectionist",
"State":"NSW",
"InCabinet":"N/A",
"Start":"1901-01-01",
@morganherlocker
morganherlocker / voxel-openstreetmap.md
Last active August 29, 2015 14:05
voxel osm vector tile algo

This is a rough spec for an implementation of a realtime virtual world using OpenStreetMap data and voxel.js. The basic idea is to encode feature data pulled from Mapbox vector tiles as overzoomed tiles, which can be represented as voxels. This allows for easy scalability, since it utilizes existing algorithms and architecture.

The initial implementation is going on here.

###general

  • 1 voxel = 1 tile at zoom 17 = 1.1943 sq meters
  • the world is a 33,554,432 x 33,554,432 voxel grid
  • assume that a server is serving up vector tile pbfs at z15 (mapbox.com, local, etc.)
  • vector tiles are loaded at zoom 15 and geometry is encoded as 4096x4096 pixel coordinates, which is equivalent to tiles at zoom 24
@geelen
geelen / 1_Readme.md
Last active August 29, 2015 14:21
Traits

Global traits, local components

The idea is to combine the best bit of global styling (reuse, small payload) and local styling (total isolation, first-class React syntax)

This is combined with the concept of traits: you can think of them as permitted property/value pairs. Instead of every component being able to have every CSS property available to it, you can reduce your permitted set to X font families, Y font-size + line-height pairs, Z foreground/background colour pairs, W padding amounts. This is based off my work using amcss on real projects — traits were the single key feature that kept me using AM.

The one-sentence explanation: A site defines a set of permitted visual features, all components are simply a combination of those features

Definitions

@drzax
drzax / monitor.sh
Created July 9, 2015 02:55
Quick and dirty site change monitoring
#!/bin/bash
while [ 1=1 ]; do
wget seattletimes.com -O st.html
git commit -a -m "Registered update"
sleep 600
done
@juliocesar
juliocesar / selection.js
Created May 23, 2011 06:11
Get the current selection in JS
function selection() {
return window.getSelection ? window.getSelection().toString() :
document.getSelection ? document.getSelection().toString() :
document.selection ? document.selection.createRange().text :
false;
}
@aemkei
aemkei / LICENSE.txt
Created May 24, 2011 16:06 — forked from 140bytes/LICENSE.txt
140byt.es - Base64 encoder
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@OiNutter
OiNutter / LICENSE.txt
Created May 26, 2011 15:36 — forked from 140bytes/LICENSE.txt
Credit Card Validation similar to the Luhn Algorithm
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Will McKenzie<www.oinutter.co.uk>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@pamelafox
pamelafox / thirdparties.js
Created August 25, 2012 00:40
isDefined
// isDefined(window, 'google');
// isDefined(window, 'google.maps.places');
var isDefined = function(parent, name) {
var parts = name.split('.');
var part = parts.shift();
var cur = parent;
while (part) {
if (cur[part]) {
cur = cur[part];
@anthonyshort
anthonyshort / grunt.js
Created September 28, 2012 07:00
My Gruntfile
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
meta: {
version: '0.1.0',
banner: '/*! Cake Marketing - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://cakemarketing.com/\n' +
@bjeanes
bjeanes / t9.rb
Last active December 16, 2015 03:49
T9 Kata
##################################################################
# Given a list of words, model a T9[1] predictive text engine. #
# #
# Input to the function will be a series of pressed digits. The #
# output should be a set of all possible words that can be built #
# using those keys as the prefix. #
# #
# [1] http://en.wikipedia.org/wiki/T9_(predictive_text) #
##################################################################