Skip to content

Instantly share code, notes, and snippets.

View danhammer's full-sized avatar

Dan danhammer

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
SELECT * FROM mytable
@danhammer
danhammer / .block
Created July 25, 2017 03:12
fresh block
license: mit
@danhammer
danhammer / .block
Last active July 25, 2017 03:29
shapes
license: mit
{"type":"Polygon","coordinates":[[[111.918395, 8.644202], [111.918405, 8.644212], [111.918405, 8.644192], [111.918551, 8.644891], [111.918561, 8.644900999999999], [111.918637, 8.645156], [111.918647, 8.645166], [111.918663, 8.64548], [111.918673, 8.645489999999999], [111.918728, 8.645999], [111.918738, 8.646009], [111.919039, 8.646318], [111.919049, 8.646328], [111.919034, 8.646434], [111.919044, 8.646443999999999], [111.919044, 8.646424], [111.919082, 8.646519], [111.919092, 8.646529], [111.9192, 8.646546], [111.91921, 8.646556], [111.919275, 8.646509], [111.919285, 8.646519], [111.919312, 8.646387], [111.91932200000001, 8.646397], [111.919409, 8.646355], [111.919419, 8.646365], [111.919763, 8.646387], [111.919773, 8.646397], [111.919773, 8.646377000000001], [111.920906, 8.646721], [111.920916, 8.646730999999999], [111.92126, 8.646742], [111.92127, 8.646752], [111.921737, 8.646657], [111.921747, 8.646666999999999], [111.922215, 8.64654], [111.922225, 8.64655], [111.92251, 8.646286], [111.92252, 8.646296], [1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danhammer
danhammer / new_road.geojson
Created August 22, 2017 04:24
New roads in Texas. Informal tracks in late 2016. Solidified in Feb 2017.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danhammer
danhammer / gale-shapely.py
Last active August 27, 2017 05:11
rough example of the gale/shapely algorithm to find a stable marriage
import random
import numpy
import tierion
# GLOBALS
MEN = ['a', 'b', 'c', 'd', 'e']
WOMEN = ['A', 'B', 'C', 'D', 'E']
MEN_PREF = {m:numpy.random.permutation(WOMEN) for m in MEN}
@danhammer
danhammer / firebase_example.py
Created May 22, 2018 20:27
An example to pull the most recent Earthrise stories
import firebase
import requests
fb = firebase.FirebaseApplication('https://overview-seeds.firebaseio.com', None)
def grab_stories(n):
# Grab the most recent `n` stories from the Where to Look (WTL) firebase
# dataset. (Some of the stories are dated far into the future, hence the
# `endAt` parameter.)
today = date.today().isoformat()