This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import requests | |
| import csv | |
| import json | |
| def getCounties(): | |
| "Function to return a dict of FIPS codes (keys) of U.S. counties (values)" | |
| d = {} | |
| r = requests.get("http://www2.census.gov/geo/docs/reference/codes/files/national_county.txt") | |
| reader = csv.reader(r.text.splitlines(), delimiter=',') | |
| for line in reader: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | mkdir -p goat && ffmpeg -i goat.mp4 -vf "transpose=1" -r 10 goat/goat%03d.png && convert -resize 50% -delay 5 -loop 0 goat/goat*.png goat.gif | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | """ | |
| Unpacking a list of tuples to test for multiple replacement values. (Borrowed from a code snippet in "Mining the Social Web": http://shop.oreilly.com/product/0636920030195.do) | |
| """ | |
| REPLACE_LIST = [ | |
| (', Incorporated',', Inc.'), | |
| (' Incorporated',' Inc.'), | |
| (', LLC',''), | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import requests | |
| import json | |
| def getDomainList(): | |
| url = "http://data.iana.org/TLD/tlds-alpha-by-domain.txt" | |
| r = requests.get(url) | |
| s = r.text.split("\n") | |
| date = s[0].split("Last Updated ")[1] | |
| js = {} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| wget http://www.ssa.gov/oact/babynames/state/namesbystate.zip -O baby_names_by_state.zip | |
| unzip baby_names_by_state.zip NE.TXT | |
| sed -e '1i\state,sex,year,name,count' NE.TXT | csvcut -c sex,year,name,count | csvjson > ne-babies.json | |
| rm NE.TXT baby_names_by_state.zip | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| wget -O fips_ref.txt http://www2.census.gov/geo/docs/reference/state.txt | |
| wget --mirror --continue --no-directories ftp://ftp2.census.gov/geo/tiger/TIGER2015/PLACE/ | |
| for f in *.zip | |
| do | |
| unzip $f | |
| done | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | """ | |
| Pings the Nebraska Auditor of Public Accounts' budget database -- http://www.nebraska.gov/auditor/reports/index.cgi?budget=1 -- and returns a cleaner, transposed csv (or JSON) of summary budget data for every political subdivision in Nebraska. | |
| ~~ ARGUMENTS ~~ | |
| outfile: name of file to write to | |
| delimit: delimiter for outfile, or pass "json" to return JSON | |
| budget_year_list: list of budget years you want to grab data for, in the form ["2013-2014", "2014-2015"] | |
| """ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import requests | |
| from bs4 import * | |
| from time import * | |
| import re | |
| from string import ascii_lowercase | |
| f = open('dougwarrants.txt', 'wb') | |
| baseurl = "http://omahasheriff.com/services/warrants/criminal?searchterm=" | |
| for letter in ascii_lowercase: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import requests | |
| from bs4 import * | |
| import time | |
| import json | |
| import os | |
| import glob | |
| # download flag gifs from CIA website | |
| def getFlags(): | |
| base = "https://www.cia.gov/library/publications/the-world-factbook/docs/flagsoftheworld.html" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import os | |
| import json | |
| import re | |
| import collections | |
| def sub(text): | |
| return re.sub("ia-|ne-|us-|-topojson|-geojson|.json|.zip", "", text) | |
| def getType(x): | |
| if "topojson" in x: |