Skip to content

Instantly share code, notes, and snippets.

View leigh-johnson's full-sized avatar

Leigh Johnson leigh-johnson

View GitHub Profile
leigh-johnson / destructuring.js
Created September 17, 2016 05:55 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic:
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
leigh-johnson /
Last active October 10, 2017 04:23 — forked from jefffriesen/
US Zip Codes

This is a d3.js visualization of US zip codes.

Original zip code dataset from Geocommons.

5MB shapefile with properties such as zipcode, state, name, population, area, more. (Thank you Bill Greer)

This converts it nicely:

leigh-johnson /
Created November 2, 2017 20:14 — forked from jckantor/
Python dateutil rule sets for NYSE trading days and holiday observances.
from dateutil import rrule
import datetime
# Generate ruleset for holiday observances on the NYSE
def NYSE_holidays(,
rs = rrule.rruleset()
# Include all potential holiday observances
rs.rrule(rrule.rrule(rrule.YEARLY, dtstart=a, until=b, bymonth=12, bymonthday=31, byweekday=rrule.FR)) # New Years Day