Skip to content

Instantly share code, notes, and snippets.

View valhalla diary.md

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

Diary

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 http://download.geofabrik.de/north-america/us/california-latest.osm.pbf
[output abbreviated]
jesse:projects/ $ cd ~/projects
@hofmannsven
hofmannsven / README.md
Created Dec 6, 2017
Increase key repeat rate on macOS
View README.md

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.

Source: https://apple.stackexchange.com/a/83923

@perrygeo
perrygeo / rgba-to-masked.py
Last active Aug 8, 2018
Convert RGBA to RGB with GeoTIFF mask
View rgba-to-masked.py
import rasterio
import click
@click.command()
@click.argument("rgba_path")
@click.argument("out_path")
@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)
View Readme.md

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
sconnelley / mapreduce.py
Last active Aug 29, 2015
Python parser for maps.stamen.com log files
View mapreduce.py
# Parses maps.stamen.com log files
# 99% of the code comes from http://pymotw.com/2/multiprocessing/mapreduce.html
# Another useful article can be found here, http://effbot.org/zone/wide-finder.htm
# Per file processing time could be improved with threads I imagine
# roughly 2k-3k files totaling ~ 150mb takes about 30min
"""
Usage:
1. Download log files from s3 into local dated directories with your weapon of choice.
@JesseCrocker
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
LANGUAGE plpgsql IMMUTABLE
AS $function$
begin
-- Don't bother if the scale is larger than ~zoom level 0
if scaledenominator > 600000000 then
return null;
@andyshinn
andyshinn / DEISAWS.md
Last active Apr 5, 2017
Deis AWS Deployment
View DEISAWS.md

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.

AWS

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
juliangruber / README.md
Last active Sep 29, 2020
lightweight node-websocketd
View README.md

node-websocketd

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

Usage

node-websocketd --port=8080 ./count.sh
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
migurski / deimgify.py
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.
View deimgify.py
#!/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.
Example:
ls *.png | xargs deimgify.py
Output:
Goodtimes.sparsebundle/Info.bckup
You can’t perform that action at this time.