Skip to content

Instantly share code, notes, and snippets.

View valhalla

Ultimate Goal: valhalla running on AWS ECS, behind a load balancer, in multiple regions, with auto scaling, with data updating once a week.


First goal: Build with docker, then cut tiles from a small extract and get server to run locally.

jesse:projects/ $ mkdir ~/valhalla-data
jesse:projects/ $ cd ~/valhalla-data
jesse:projects/ $ wget
[output abbreviated]
jesse:projects/ $ cd ~/projects
hofmannsven /
Created Dec 6, 2017
Increase key repeat rate on macOS

Increase key repeat rate on macOS

Settings: System Preferences » Keyboard » Key Repeat/Delay Until Repeat

Use the commands below to increase the key repeat rate on macOS beyond the possible settings via the user interface. The changes aren't applied until you restart your computer.


perrygeo /
Last active Aug 8, 2018
Convert RGBA to RGB with GeoTIFF mask
import rasterio
import click
@click.option("--internal-mask/--external-mask", default=True)
@click.option("--ycbcr", default=False, is_flag=True)
@click.option("--use-blocks/--no-use-blocks", default=True)

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

sconnelley /
Last active Aug 29, 2015
Python parser for log files
# Parses log files
# 99% of the code comes from
# Another useful article can be found here,
# Per file processing time could be improved with threads I imagine
# roughly 2k-3k files totaling ~ 150mb takes about 30min
1. Download log files from s3 into local dated directories with your weapon of choice.
JesseCrocker / gist:f1130d63b7a37d3abc0a
Created Jul 10, 2014
Function to convert mapnik scale to TMS zoom, courtesy of Mapbox.
View gist:f1130d63b7a37d3abc0a
-- ---------------------------------------------------------------------
-- converts mapnik's !scale_denominator! param to web mercator z
CREATE OR REPLACE FUNCTION public.z(scaledenominator numeric)
RETURNS integer
AS $function$
-- Don't bother if the scale is larger than ~zoom level 0
if scaledenominator > 600000000 then
return null;
andyshinn /
Last active Apr 5, 2017
Deis AWS Deployment

Deploying Deis on AWS

These instructions will get you up and running with Deis and CoreOS in a AWS VPC. There already exists a CloudFormation script to get up and running in AWS. But if you want to get down and dirty, this document will help walk you through the steps.

I tried to build these instructions for both the AWS web console and equivilent AWS CLI. If you find errors, please feel free to comment so I can update them. You can also find me in the #deis IRC channel on Freenode if you have questions.


Since we will be running CoreOS and Deis inside a VPC we need some AWS setup first. We need a single subnet VPC, some security groups, and instances of CoreOS.

juliangruber /
Last active Mar 24, 2021
lightweight node-websocketd


A lightweight node port of websocketd, originally written in go.


node-websocketd --port=8080 ./
View continuous-perlin.js
var perlin = require('perlin').noise.perlin3
var fill = require('ndarray-fill')
var zeros = require('zeros')
var scale = 0.075
var threshold = 0.125
// Untested in 3D, but "theoretically" this should
// work. Using the equivalent 2d getter with the
// continuous-box2d demo works well.
migurski /
Last active Dec 17, 2015
Store sparse bundle disk images as a series of 24 bit losslessly-encoded PNG images. Let Flickr’s 1TB of storage hold them for you.
#!/usr/bin/env python
''' Convert a series of PNG images to a sparse bundle disk image.
Image file names are passed in as command line arguments.
ls *.png | xargs