Skip to content

Instantly share code, notes, and snippets.

@jqtrde
jqtrde / _.md
Created January 19, 2015 22:25
color scales
@jqtrde
jqtrde / _.md
Created January 19, 2015 22:24
color scales
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.3.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.3.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@jqtrde
jqtrde / index.html
Last active August 29, 2015 14:08
ey gurl
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.3.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.3.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@jqtrde
jqtrde / README.md
Last active August 29, 2015 14:08 — forked from jasondavies/README.md

Based on Mike Bostock’s [World Map][0], modified to automatically colour countries such that no adjacent countries share the same colour.

This is done by extracting the topology via [TopoJSON][1] and greedily picking colours until the constraint is fulfilled.

See also: [Graph coloring][2] on Wikipedia.

Update: Greedily colouring is now performed in a single line, thanks to Mike Bostock!

@jqtrde
jqtrde / L8.sh
Last active August 29, 2015 14:06 — forked from YKCzoli/L8.sh
#!/bin/bash
echo "Enter bands (ie 4 3 2)"
read B1 B2 B3
echo "Enter the resulting filename"
read outputname
@jqtrde
jqtrde / data.tsv
Last active August 29, 2015 14:05 — forked from mbostock/.block
sepalLength sepalWidth petalLength petalWidth species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa
4.6 3.4 1.4 0.3 setosa
5.0 3.4 1.5 0.2 setosa
4.4 2.9 1.4 0.2 setosa
#!/bin/bash
# Mac OSX 10.8 geo setup script
# loads geo stuffs, mostly through homebrew
###################
# Before running:
# - Install Xcode from the Mac App Store.
# - Install the Xcode Command Line Tools by opening Xcode,
# Xcode → Preferences → Downloads → Components →