Skip to content

Instantly share code, notes, and snippets.

View clhenrick's full-sized avatar

Chris Henrick clhenrick

View GitHub Profile
@clhenrick
clhenrick / StartAudioContext.js
Created January 7, 2018 21:29 — forked from AvneeshSarwate/basic.html
Tone.Sequence not running on iOS
/**
* 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 June 27, 2016 00:23 — forked from mbostock/.block
Shape Tweening
license: gpl-3.0
@clhenrick
clhenrick / README.md
Created June 15, 2016 20:15 — forked from almccon/README.md
turbo-cartocss examples

Color ramps: *-fill

Basic usage

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

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, 
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')
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
@clhenrick
clhenrick / jsonp.js
Last active August 29, 2015 14:16 — forked from gf3/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
<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>