Skip to content

Instantly share code, notes, and snippets.

View darthmall's full-sized avatar

Evan Sheehan darthmall

View GitHub Profile
@darthmall
darthmall / toots.py
Created October 7, 2011 23:20
A simple Python 3 script to scrape toots from twitter and dump them in a SQLite database.
#!/usr/bin/env python3
from urllib.parse import urlencode
from urllib.request import urlopen
import itertools, json, sqlite3
# Constants
TWITTER_SEARCH_URL = 'http://search.twitter.com/search.json?'
# Simple database schema, largely for enforcing uniqueness
@darthmall
darthmall / README.md
Last active December 10, 2015 12:39
The Lottery of Life

Redesigning the Economists Lottery of Life table.

Countries are organized along the x-axis according to their rank and colored based on continent. Hover over the legend to highlight all entries for a continent, or hover over a point or a label to highlight that one entry.

@darthmall
darthmall / csv_merge.py
Created February 8, 2013 20:17
Simple Python script for merging rows in a CSV based on some key column.
#!/usr/bin/env python
import csv
import sys
records = {}
keyfield = sys.argv[2]
with file(sys.argv[1], 'rU') as f:
@darthmall
darthmall / README.md
Created February 9, 2013 03:05
Bubble chart of highest income tax rate vs highest income tax bracket in 2012. Sized by GDP per capita.

Bubble chart of highest income tax rate vs highest income tax bracket in 2012. Sized by GDP per capita.

@darthmall
darthmall / README.md
Last active December 16, 2015 11:49
The Lexicon of They Might Be Giants.
@darthmall
darthmall / app.js
Last active December 17, 2015 00:39
AppJS data explorer.
var app = module.exports = require('appjs');
var sqlite3 = require('sqlite3').verbose();
// Store a reference to the objects generated from the SQLite database in bins.
// This seems to prevent the application from crashing, probably by ensuring
// these objects aren't deallocated.
var bins, db;
function density(cutoff, unoccupied, callback) {
@darthmall
darthmall / index.js
Created May 7, 2015 17:14
Callbacks for Promise.all with and without lodash.spread
// Without lodash
function doSomething(results) {
var fooResult = results[0];
var barResult = results[1];
}
Promise.all([foo, bar]).then(doSomething);
// With lodash

Keybase proof

I hereby claim:

  • I am darthmall on github.
  • I am darth_mall (https://keybase.io/darth_mall) on keybase.
  • I have a public key whose fingerprint is 1C37 B4CA 4C28 97D0 4723 5E8D 9110 CDB4 4BE4 17A8

To claim this, I am signing this object:

@darthmall
darthmall / index.html
Last active August 10, 2016 01:09
Animated bar chart transitions
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.axis .domain {
display: none;
}
.tick line {
stroke: #CCC;
}
@darthmall
darthmall / README.md
Last active March 26, 2017 21:12
NYPhil performance archive and composer network

Initial exploration of the NYPhil performance history archive.

The column charts show the number of unique programs, concert dates, composers, works, and conductors per season. The network shows links between composers that were programmed together, where the link strength is based on the pointwise mutual information between the two composers.