Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Henrick clhenrick

View GitHub Profile
@clhenrick
clhenrick / StartAudioContext.js
Created Jan 7, 2018 — forked from AvneeshSarwate/basic.html
Tone.Sequence not running on iOS
View StartAudioContext.js
/**
* StartAudioContext.js
* @author Yotam Mann
* @license http://opensource.org/licenses/MIT MIT License
* @copyright 2016 Yotam Mann
*/
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define([], factory)
} else if (typeof module === "object" && module.exports) {
@clhenrick
clhenrick / .block
Created Jun 27, 2016 — forked from mbostock/.block
Shape Tweening
View .block
license: gpl-3.0
@clhenrick
clhenrick / README.md
Created Jun 15, 2016 — forked from almccon/README.md
turbo-cartocss examples
View README.md

Color ramps: *-fill

Basic usage

marker-fill: ramp([column_name], colorbrewer(Greens));
                  |                    |
                  v                    |
      column to calculate ramp         |
                                       v
@clhenrick
clhenrick / README.md
Last active Jun 15, 2016 — forked from syntagmatic/README.md
Colorspaces
View README.md
@clhenrick
clhenrick / A_day_with_SQL.md
Last active Aug 29, 2015 — forked from aepyornis/A_day_with_SQL.md
From Ziggy's NYC Turn On The Heat! map: http://turnontheheat.nyc/
View A_day_with_SQL.md

A day in SQL HELL: or how I learned to like (or at least appreciate) SQL by ziggy

In short: the secret to who owns nyc will probably be found in a really complicated sql statement

Here's how this all started. I was working on my project to analyze heat/hot water complaints. I downloaded all the complaints for this heat season (there's over 200,00), geocoded them to obtain the bbls, and then imported them into postgres. I wanted to match complaints with their owners in order to find out whose responsible for not providing tenants' with essential services.

So I fired up PSQL and started typing out some queries.

SELECT bbl, 
View geocode-dhcr-list.py
import csv
import urllib
import re
from nyc_geoclient import Geoclient
from sys import argv
from sys import exit
script, infile, outfile = argv
g = Geoclient('9cd0a15f', '54dc84bcaca9ff4877da771750033275')
View gist:bc741963eca6650378af
urlencode() {
# urlencode <string>
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
*) printf '%%%02X' "'$c"
esac
View jsonp.js
/**
* loadJSONP( url, hollaback [, context] ) -> Null
* - url (String): URL to data resource.
* - hollaback (Function): Function to call when data is successfully loaded,
* it receives one argument: the data.
* - context (Object): Context to invoke the hollaback function in.
*
* Load external data through a JSONP interface.
*
* ### Examples
View Sublime Text 2 HTML5 Boilerplate Snippet
<snippet>
<content><![CDATA[<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>${1:Project Name}</title>
You can’t perform that action at this time.