Skip to content

Instantly share code, notes, and snippets.

View ryanpitts's full-sized avatar

Ryan Pitts ryanpitts

View GitHub Profile
@ryanpitts
ryanpitts / The entire history of MLB batting via Sean Lahman's 2012 update
Created February 7, 2012 00:26
csvstat results for batting.csv as of 2012
1. playerID
<type 'unicode'>
Nulls: No
Unique values: 17661
5 most frequent values:
mcguide01: 31
henderi01: 29
newsobo01: 29
kaatji01: 28
johnto01: 28
@ryanpitts
ryanpitts / The entire history of MLB pitching via Sean Lahman's 2012 update
Created February 7, 2012 00:31
csvstat results for pitching.csv as of 2012
1. playerID
<type 'unicode'>
Nulls: No
Unique values: 8551
5 most frequent values:
newsobo01: 29
kaatji01: 28
johnto01: 28
carltst01: 27
ryanno01: 27
while true; do read -a choices <<<'Agnes Kathy Princess Vicki Victoria Bruce Fred Junior Ralph Albert Bahh Bells Boing Bubbles Cellos Deranged Hysterical Trinoids Whisper Zarvox'; n=${#choices[*]}; voice=${choices[$((RANDOM%n))]}; curl https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=wmhartnett\&max_id=200303011078213633\&count=1 | grep '<description>.*</description>' | sed -e 's/<\/*description>//g' -e 's/ \/ wmhartnett//g' -e 's/Twitter updates from William M. Hartnett//g' -e 's/wmhartnett: //g' | sed 's/.*://g' | say -v $voice; sleep 1; done
@ryanpitts
ryanpitts / gist:3744662
Created September 18, 2012 17:57
SpoBeerFriends July 2012
Rogue Voodoo Doughnut Bacon Maple
Stone Double Bastard (2011)
Epic Brewing Brainless on Peaches
Epic Brewing Utah Sage Saison
Maui Sobrehumano Palena ‘ole
Sierra Nevada Bigfoot Barlyewine (2010)
Sierra Nevada 30th Anniversary Grand Cru
Sierra Nevada Hoptimum
North Coast Brother Thelonious
Lagunitas IPA (with whiskey wash)
@ryanpitts
ryanpitts / ZenOfNewsApps
Last active October 12, 2015 20:18
Quotes to inspire news nerds.
#ADRIA, F.
"We didn't create dishes. We create preparations to create many dishes." - Ferran Adria
#BOURDAIN, A.
"This bus makes many stops. I have no expectation that you will like all of them." - @Bourdain
#BOYER, B.
"Election maps lie." - @brianboyer
"Who are our users? What do they need?" - @brianboyer
@ryanpitts
ryanpitts / fuzzyboyle.py
Created November 21, 2012 18:20
A Python script using FuzzyWuzzy to find the recent @andymboyle tweet that most resembles random mashing on a keyboard.
#!/usr/bin/python
import random
import string
import twitter
from fuzzywuzzy import process
api = twitter.Api()
recent_tweets = api.GetUserTimeline('andymboyle')
tweet_list = [tweet.text for tweet in recent_tweets]
@ryanpitts
ryanpitts / scotchy.txt
Created November 29, 2012 00:45
Scotch tour (from what I have on hand, at least)
SPEYSIDE
- Macallan 12
LOWLAND
- Glenkinchie Distiller's Edition
HIGHLAND
- Glenmorangie Cellar 13
SPEYSIDE (compare regular bottling vs. cask strength)
@ryanpitts
ryanpitts / summary_level_dict
Last active April 6, 2021 15:24
Summary level codes for Census and ACS
# Sources:
# http://mcdc2.missouri.edu/pub/data/sf32000/Techdoc/ch4_summary_level_seq_chart.pdf
# http://www2.census.gov/acs2011_1yr/summaryfile/ACS_2011_SF_Tech_Doc.pdf
SUMMARY_LEVEL_DICT = {
"010","United States",
"020","Region",
"030","Division",
"040","State",
"050","State-County",
"060","State-County-County Subdivision",
BROKEN INTO FOUR THEMES
Demographic characteristics
- age
- gender
- race
Economic characteristics
- employment
- income
Things we might highlight on the analysis view page for a given geography.
DEMOGRAPHICS
Age
- population chart (split histogram) of male/female population by decade (0-9, 10-19, 20-29, etc.)
- % male population, % female population, male/female ratio
- median age, % population under 18, % population under 21, % population over 65
- narrative graf describing how this geography fits into context with parent geography, state, nation