Skip to content

Instantly share code, notes, and snippets.

@brianboyer
brianboyer / ratings.sh
Last active June 10, 2016 22:19
Finding the top-rated home care providers for an area, as listed in Medicare's Home Health Compare data
#!/bin/bash
#
# Because https://www.medicare.gov/homehealthcompare/ does not provide any way to
# search for providers by their ratings, we've got to do this the hard way.
# Luckily, with csvkit the hard way isn't so hard. Get it here http://csvkit.readthedocs.io/
#
# First, download the data from https://data.medicare.gov/data/home-health-compare
#
curl -o HHCompare_Revised_FlatFiles.zip "https://data.medicare.gov/views/bg9k-emty/files/36e8f3b0-0273-4b46-ba04-89f089678a84?content_type=application%2Fzip%3B%20charset%3Dbinary&filename=HHCompare_Revised_FlatFiles.zip"
#
@brianboyer
brianboyer / gist:c9d412a26cb57b5ebbc7
Created November 6, 2014 14:57
Convert a mailbox file into CSV
# assumes your file is called mbox (which it is if you export from Mac Mail)
# writes to a file called mbox.csv
import mailbox
import csv
# motherfucking recursion, because email is damn weird.
# each payload can contain many other payloads, which can contain many *other* payloads
# this only exports the text/plain payload, the thing you read
def more_payloads(message):
@brianboyer
brianboyer / gist:2883018
Created June 6, 2012 16:20
Batch remove connections from linkedin
// visit the remove connections page
// http://www.linkedin.com/connections?displayBreakConnections=&goback=%2Econ
//pull up your javascript console
// load jQuery
(function(){
var newscript = document.createElement('script');
newscript.type = 'text/javascript';
newscript.async = true;
@brianboyer
brianboyer / gist:2648545
Created May 9, 2012 20:25
Applescript for PowerMate that resizes a window for responsive web design testing
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) + 100
set size to {newWidth, item 2 of oldSize}
end tell
@brianboyer
brianboyer / import_tix.py
Created March 16, 2012 16:16
Unfuddle ticket generator
import csv, os.path
import os
import httplib, base64
import getpass
username = raw_input("Username:")
password = getpass.getpass("Password:")
subdomain = raw_input("Subdomain:")
project = raw_input("Project id:")
filename = raw_input("Tickets file:")
@brianboyer
brianboyer / gist:1696819
Created January 29, 2012 02:21
Lion dev environment notes
@brianboyer
brianboyer / popluation-change.mss
Created February 18, 2011 14:52
Carto stylesheet for our census map
/*
Our favorite new tool: http://tilemill.com/
See the results here: http://media.apps.chicagotribune.com/census-2010/population-change/index.html
*/
@sans-bold:"Arial Bold";
#tracts[name = "Census Tract 9900"] {
polygon-opacity:0;
}
@brianboyer
brianboyer / import_usat
Created February 16, 2011 16:50
PostgreSQL importer for the pre-processed census files provided to IRE members by Paul Overberg and Anthony DeBarros from USA Today.
#! /bin/sh
#
# usat_import
# Created by Ryan Nagle, Chris Groskopf and Brian Boyer
#
# PostgreSQL importer for the pre-processed census files provided to IRE
# members by Paul Overberg and Anthony DeBarros from USA Today.
#
# To get the source files, join IRE (it's cheap!):
# http://www.ire.org/getcensus/