Skip to content

Instantly share code, notes, and snippets.

@popovichN
popovichN / states lookup
Last active March 17, 2019 16:58
State fips and abbreviations (JSON)
[
{"name":"Alabama","abbrev":"AL","fips":"01"},
{"name":"Alaska","abbrev":"AK","fips":"02"},
{"name":"Arizona","abbrev":"AZ","fips":"04"},
{"name":"Arkansas","abbrev":"AR","fips":"05"},
{"name":"California","abbrev":"CA","fips":"06"},
{"name":"Colorado","abbrev":"CO","fips":"08"},
{"name":"Connecticut","abbrev":"CT","fips":"09"},
{"name":"Delaware","abbrev":"DE","fips":"10"},
{"name":"District of Columbia","abbrev":"DC","fips":"11"},
@tmcw
tmcw / togeo.py
Created August 11, 2012 18:53
geo-assign any arbitrary image to a geotiff usable in tilemill
import subprocess
import sys, re
MERC = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs'
infile = sys.argv[1]
info_output = subprocess.Popen(['gdalinfo', infile], stdout=subprocess.PIPE).communicate()[0]
size_is_re = re.compile('Size is (?P<width>\d+), (?P<height>\d+)')
size_is = filter(lambda x: x, map(lambda x: size_is_re.match(x), info_output.split('\n')))
@gre
gre / easing.js
Last active October 30, 2024 16:49
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@dylanvee
dylanvee / ir_black.bbcolors
Created September 28, 2011 17:11 — forked from pgib/bbedit_colours.sh
IR_Black theme for TextWrangler
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>(null)_Other</key>
<string>rgba(0.866667,0.031373,0.023529,1.0)</string>
<key>(null)_Spaces</key>
<string>rgba(0.498039,0.498039,0.498039,1.0)</string>
<key>BackgroundColor</key>
<string>rgba(0.122179,0.122179,0.122179,1.0)</string>
@jcsrb
jcsrb / gist:1081548
Created July 13, 2011 23:05
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version