Skip to content

Instantly share code, notes, and snippets.

@samuelleach
samuelleach / install.md
Created May 20, 2017 20:42 — forked from iandees/install.md
Installing and running Project OSRM, the OpenStreetMap-based routing engine, on an Amazon EC2 instance.

My goal here was the create a routable graph for Chicago.

I used Ubuntu 12.04LTS on an m2.4xlarge just to be sure memory wasn't too much of an issue.

Install

Start a screen session and start downloading an OSM extract (I used this extract of Illinois). In another screen I did the following:

  sudo apt-get update && sudo apt-get upgrade -y

sudo apt-get -y install git make cmake build-essential \

@samuelleach
samuelleach / index.js
Created May 3, 2016 20:21 — forked from morganherlocker/index.js
tile-reduce + cheap-ruler example
var tileReduce = require('tile-reduce');
var path = require('path');
tileReduce({
zoom: 14,
map: path.join(__dirname, '/process.js'),
sources: [
{name: 'ways', mbtiles: 'ways.mbtiles')}
]
});
Step One
Fetch URL based on column:
'http://www.datasciencetoolkit.org/maps/api/geocode/json?sensor=false&address=' + escape(value, 'url')'
Step Two
Parse Json for longitude:
value.parseJson()["results"][0]["geometry"]["location"]["lng"]

Using d3.geo.tile to display raster image tiles underneath some TopoJSON vectors, and d3.behavior.zoom for pan & zoom.

@samuelleach
samuelleach / index.html
Last active December 16, 2015 11:28 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.link {
stroke: #000;
}
.node {
fill: #ccc;
@samuelleach
samuelleach / git
Created March 26, 2013 09:15 — forked from chyld/git
# ----------------------------------------------------------------- #
REFERENCES
# ----------------------------------------------------------------- #
http://ndpsoftware.com/git-cheatsheet.html
# ----------------------------------------------------------------- #
BASIC
# ----------------------------------------------------------------- #
@samuelleach
samuelleach / README.md
Last active December 14, 2015 17:28 — forked from mbostock/.block
@samuelleach
samuelleach / .bashrc
Last active December 11, 2015 19:49 — forked from henrik/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"