Skip to content

Instantly share code, notes, and snippets.

View lathropd's full-sized avatar

Daniel Lathrop lathropd

View GitHub Profile
@lathropd
lathropd / .env
Last active August 29, 2015 14:06
Nice default .env file to use with Python virtualenv, autovenv and virtualenvwrapper. First checks for environment with name of current directory, then localvenv, then error
dir=`pwd`
dirbase=`basename $dir`
workon $dirbase|| source venv/bin/activate || echo "No virtual environment available, check .env"
@lathropd
lathropd / shp2svg.sh
Created October 13, 2014 16:25
Shapefile to SVG
#!/usr/bin/env bash
# usage shp2svg [input file] [id field] [output file]
# all three attributes are required (may change that later)
# requires the topojson node package: npm install topojson
topojson --id-property $2 --width 960 --height 800 --margin 20 -s .25 --projection 'd3.geo.albersUsa()' $1 | topojson-svg -o $3
We can't make this file beautiful and searchable because it's too large.
item_number,category,product,vendor_id,vendor_name,bottle_ml,pack_size,inner_pack,age,proof,list_date,list_year,upc,scc,state_bottle_cost,state_case_cost,state_bottle_retail,report_date
31544,AMERICAN DRY GINS,No. 209 Gin,13,"209, Ltd",750,6,1,0,92,07/01/2008,2008,,,17.59,105.55,26.39,01/04/16
951175,FLAVORED RUM,Kirk & Sweeney 12YR Old Anejo,110,3 Badge Mixology,750,6,1,12,80,01/01/2016,2016,856442005086,856442005086,17.5,105,26.25,01/04/16
13728,CANADIAN WHISKIES,Masterson's 10YR Straight Barley,110,3 Badge Mixology,750,6,1,0,92,12/01/2013,2013,89105810073,89105810073,39.42,236.5,59.13,01/04/16
13730,STRAIGHT RYE WHISKIES,Masterson's 10YR Straight Rye,110,3 Badge Mixology,750,6,1,0,90,12/01/2013,2013,89105810066,89105810066,39.42,236.5,59.13,01/04/16
32650,FLAVORED GINS,Uncle Val's,110,3 Badge Mixology,750,6,1,0,90,12/01/2013,2013,85924100319,85924100319,22.09,132.5,33.14,01/04/16
42511,SPICED RUM,Kirk & Sweeney,110,3 Badge Mixology,750,6,1,0,80,12/01/2013,2013,89105310115,89105310115,22.09,132.5,33.14,01/0
1 2 34 4 5 5
@lathropd
lathropd / whitman.csv
Created January 27, 2016 21:47
whitman data file for whitman fiction map
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
Type,Author,Location,Page_Numbers,City,Title,master,Source Database,State,Unique ID,Date,date_fmt,Kind of Periodical,geo_accuracy,Publication,geo_latitude,geo_longitude
Reprint,Unsigned,"Placerville, California",2,Placerville,"""Shirval: A Tale of Jerusalem.""",shirval,Newspaper Archive,California,wwa.331,"January 25, 1879",01/25/1879,Newspaper,city,The Mountain Democrat,38.7307105,-120.796302578
Reprint,Unsigned,"Ukiah City, California",6,Ukiah City,"""Shirval: A Tale of Jerusalem.""",shirval,Newspaper Archive,California,wwa.332,"February 14, 1879",02/14/1879,Newspaper,aerodrome,Ukiah City Press,39.12728615,-123.202070478
Reprint,Unsigned,"Rock Island, Stanstead, Canada",1,"Rock Island, Stanstead","""A Legend of Life and Love""",life and love,Google News Archive,Canada,wwa.230,"August 31, 1846",08/31/1846,Newspaper,locality,Stanstead Journal,45.0069801,-72.0961764
Reprint,Walker Whitman,"Denver, Colorado",18,Denver,"""The Last of the Sacred Army""",sacred army,19th Century U. S. Newspapers,Colorado,wwa.339,"
@lathropd
lathropd / us.json
Last active January 27, 2016 21:52
us states and counties geojson for whitman project
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lathropd
lathropd / Daniel Lathrop's home page.markdown
Created January 28, 2016 22:20
Daniel Lathrop's home page

Daniel Lathrop's home page

The home page of Daniel Lathrop, Iowa journalism professor and freelance journalist. I ♥ code.

A Pen by Daniel Lathrop on CodePen.

License.

We can't make this file beautiful and searchable because it's too large.
Year,Year Ending,County Name,County Code,Motor Vehicle,Vehicle Category,vehicle_type,Tonnage,Registrations,Annual Fee,Primary County Lat,Primary County Long,Primary County Coordinates
2005,12/31/2005,Adair,1,No,Trailer,Semi Trailer,,599,,41.330746400000002,-94.470941300000007,"(41.330746400000002, -94.470941300000007)"
2005,12/31/2005,Adair,1,No,Trailer,Travel Trailer,,292,,41.330746400000002,-94.470941300000007,"(41.330746400000002, -94.470941300000007)"
2005,12/31/2005,Adair,1,No,Trailer,Small Regular Trailer,,915,,41.330746400000002,-94.470941300000007,"(41.330746400000002, -94.470941300000007)"
2005,12/31/2005,Adair,1,No,Trailer,Regular Trailer,,410,,41.330746400000002,-94.470941300000007,"(41.330746400000002, -94.470941300000007)"
2005,12/31/2005,Adair,1,No,Trailer,Small Semi Trailer,,3,,41.330746400000002,-94.470941300000007,"(41.330746400000002, -94.470941300000007)"
2005,12/31/2005,Adair,1,Yes,Truck,Truck Tractor,,122,,41.330746400000002,-94.470941300000007,"(41.330746400000002, -94.470941300000007)"
We can't make this file beautiful and searchable because it's too large.
AgeGroup,YearsServed,OffenseClassMostSeriousCrime,OffenseTypeMostSeriousCrime,OffenseSubtypeMostSeriousCrime,Sex,Race,EthnicOrigin,Status,Jurisdiction,ServingLifewithoutParole,ServingLifewithPossibilityofParole
17 & Under,Less Than 1 Year,D Felony,Public Order,Weapons,Male,Black,Non-Hispanic,Iowa Prisoner,Buena Vista,,
17 & Under,Less Than 1 Year,C Felony,Violent,Other Violent,Male,Black,Non-Hispanic,Iowa Prisoner,Scott,,
17 & Under,Less Than 1 Year,C Felony,Violent,Other Violent,Male,Black,Non-Hispanic,Iowa Prisoner,Scott,,
17 & Under,Less Than 1 Year,Aggravated Misdemeanor,Violent,Assault,Male,White,Non-Hispanic,Iowa Prisoner,Polk,,
17 & Under,Less Than 1 Year,D Felony,Violent,Assault,Male,White,Non-Hispanic,Iowa Prisoner,Butler,,
17 & Under,Less Than 1 Year,D Felony,Public Order,Weapons,Male,Black,Non-Hispanic,Iowa Prisoner,Black Hawk,,
17 & Under,Less Than 1 Year,C Felony,Violent,Robbery,Male,Black,Non-Hispanic,Iowa Prisoner,Black Hawk,,
17 & Under,Less Than 1 Year,C Felony,Violent,Robbery,Male,Black,Non-
item_number,category,product,vendor_id,vendor_name,bottle_ml,pack_size,inner_pack,age,proof,list_date,list_year,upc,scc,state_bottle_cost,state_case_cost,state_bottle_retail,report_date
904668,BLENDED WHISKIES,Hirsch Selection 20yr,391,Anchor Distilling (PREISS IMPORTS),750,1,1,0,96,2/9/10,2010,,,50,50,75,1/4/16
4853,BLENDED WHISKIES,Dewar's White Label Scratched Cask,35,"Bacardi U.S.A., Inc.",750,6,1,0,80,5/1/15,2015,80480005726,80480005726,16.75,100.48,25.13,1/4/16
994993,BLENDED WHISKIES,77 Whiskey New York Wheat,119,Breuckelen Distilling,750,12,1,0,90,7/1/15,2015,13964201925,13964201925,27.84,334,41.76,1/4/16
27318,BLENDED WHISKIES,Two Jay's Iowa Corn Whiskey,86,Broadbent Distillery,750,12,1,0,80,3/1/11,2011,7.36212E+11,7.36212E+11,13.87,166.36,20.81,1/4/16
27323,BLENDED WHISKIES,Two Jay's Country Style Blended Why.,86,Broadbent Distillery,750,12,1,0,80,8/1/11,2011,7.36212E+11,7.36212E+11,15.59,187,23.39,1/4/16
27280,BLENDED WHISKIES,Ginos Oak,86,Broadbent Distillery,750,12,1,0,80,11/1/12,2012,7.61957E+11