I hereby claim:
- I am perliedman on github.
- I am liedman (https://keybase.io/liedman) on keybase.
- I have a public key whose fingerprint is 555C 82CE 057A 1598 9580 BD5A 95EE 964B 2EA9 FB22
To claim this, I am signing this object:
var _log = console.log; | |
console.log = function() { | |
var e = document.getElementById('log'), | |
i; | |
for (i = 0; i < arguments.length; i++) { | |
e.innerHTML = e.innerHTML + arguments[i] + '\n'; | |
} |
I hereby claim:
To claim this, I am signing this object:
def unhash(h): | |
s = '' | |
letters = 'acdegilmnoprstuw' | |
while h > 7: | |
v = h % 37 | |
s = letters[v] + s | |
h /= 37 | |
return s |
var fs = require('fs'); | |
var svg = require('svg-sketch')(); | |
var size = [400, 400]; | |
var concat = require('concat-stream'); | |
var Pdf = require('svg-sketch-pdf'); | |
var controls = require('svg-sketch-controls'); | |
controls.control.setPaperSize(size); | |
var iframe = document.createElement('iframe'); | |
iframe.setAttribute('style', 'width: 400px; height: 400px; border: solid 2px #888; border-radius: 5px; position: fixed; top: 0; left: 0'); |
function logObject(o, indent) { | |
var keys; | |
indent = indent || ''; | |
try { | |
keys = Object.keys(o); | |
} catch (e) { | |
console.log(indent + '=' + o.toString()); | |
return; |
var request = require('simple-get'), | |
extend = require('extend'); | |
function DistanceMatrix(features, options) { | |
this.options = extend({}, { serviceUrl: 'http://router.project-osrm.org/table'}, options); | |
this._features = features.features.reduce(function(fs, f, i) { | |
if (f.geometry.type !== 'Point') { | |
throw 'Feature geometries must be Points.'; | |
} |
For the proper source, and other examples, please see the original gist and the extended version
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Gypsum</title> | |
<link rel="stylesheet" type="text/css" href="http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.css"/> | |
<link rel="stylesheet" type="text/css" href='https://raw.github.com/jacobtoye/Leaflet.iconlabel/master/dist/leaflet.iconlabel.css'/> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<script src='http://cdn.leafletjs.com/leaflet-0.4.4/leaflet.js'></script> |
# Imports all GSD shape data to a database. | |
# NOTE: If the db exists, it is *dropped* before importing any data | |
DB=lmv | |
GSD_PATH=/media/local/MapData/lmv-shape | |
SQL_LOG=/dev/null | |
ERROR_LOG=gsd_import.log | |
# Create a clean slate | |
rm $SQL_LOG |
var osmium = require('osmium'); | |
var bboxPolygon = require('turf-bbox-polygon'); | |
var path = process.argv[2]; | |
var reader = new osmium.BasicReader(path); | |
var handler = new osmium.Handler(); | |
var locHandler = new osmium.LocationHandler(); | |
var header = reader.header(); | |
var bound = header.bounds[0], | |
extent = [bound.left(),bound.bottom(),bound.right(),bound.top()], | |
extentPolygon = bboxPolygon(extent); |