Skip to content

Instantly share code, notes, and snippets.

View eyeseast's full-sized avatar

Chris Amico eyeseast

View GitHub Profile
@wboykinm
wboykinm / compile_zillow_neighborhoods.sh
Last active July 9, 2020 18:40
Quickly compile all of Zillow's neighborhood geodata into a single national file
# Data courtesy of Zillow, attribution required: https://www.zillow.com/howto/api/neighborhood-boundaries.htm
# Requires GDAL/OGR: http://www.gdal.org/
STATES=("AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DC" "DE" "FL" "GA" "HI" "ID" "IL" "IN" "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH" "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN" "TX" "UT" "VT" "VA" "WA" "WV" "WI")
rm -rf zillow_neighborhoods.*
for s in "${STATES[@]}"; do
echo "Processing $s"
wget -c https://www.zillowstatic.com/static/shp/ZillowNeighborhoods-$s.zip -O $s.zip
unzip $s.zip
@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
@onyxfish
onyxfish / README.md
Created March 30, 2017 14:06
Import the entire Bureau of Labor Statistics (BLS) Quarterly Census of Wages (QCEW) dataset into a PostgreSQL database

QCEW Data Loader

These scripts import the entire Bureau of Labor Statistics Quarterly Census of Employement and Wages (from 1990 to latest) into one giant PostgreSQL database.

The database created by this process will use about 100GB of disk space. Make sure you have enough space available before you start!

Configuration

Database name, table name, and more can be configured via config.sh.

@myersjustinc
myersjustinc / README.md
Last active March 8, 2023 20:39
Remove Great Lakes and other water from Congressional districts shapefile

Remove Great Lakes and other water from Congressional districts shapefile

The problem

You want the most up-to-date shapefile of Congressional districts, but you don't want Michigan to be a giant blob.

(The Census Bureau offers some cartographic boundary shapefiles without this problem, but they aren't always the most current.)

#! /bin/bash -ex
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * Dan Stahlke's https://github.com/gina-alaska/dans-gdal-scripts
# * convert (image-magick)
#
# Reference info:
import asyncio
import aiohttp
import os
import random
import re
import sys
import traceback
from io import StringIO
from lxml.html import parse, make_links_absolute
from lxml.cssselect import CSSSelector
@dannguyen
dannguyen / matplotlib-basemap-python3x-quakes.md
Last active January 24, 2023 07:22
How to use matplotlib's basemap and Python 3.x to plot earthquake data on a world map

Mapping earthquakes in Python 3.x using matplotlib and matplotlib's basemap

(with a big assist from Anaconda)

I currently use Python for nearly all of my data science and wrangling work these days but usually find myself switching to R to visualize data using ggplot2. This is due in part to ggplot2's general excellence, but also because I had a lot of trouble learning Python's most popular viz library, matplotlib on my own...its homepage is decent enough...but its variety of plotting APIs (--pylab? OOP? %matplotlib???) has led to widely differing examples and best practices among the many online matplotlib guides (not dissimilar to the general problem of trying to practice either Python 2.x or 3.x).

That changed yesterday when I stumbled across [Nicolas P. Rougier's beautifully designed and com

@cnizzardini
cnizzardini / nfl_teams.csv
Last active January 30, 2024 23:03
List of nfl teams as a CSV: name,abbreviation,conference,division for MySQL format. Please comment if you find any errors.
ID Name Abbreviation Conference Division
1 Arizona Cardinals ARI NFC West
2 Atlanta Falcons ATL NFC South
3 Baltimore Ravens BAL AFC North
4 Buffalo Bills BUF AFC East
5 Carolina Panthers CAR NFC South
6 Chicago Bears CHI NFC North
7 Cincinnati Bengals CIN AFC North
8 Cleveland Browns CLE AFC North
9 Dallas Cowboys DAL NFC East
@eyeseast
eyeseast / ideas.md
Created January 13, 2016 22:14
Structured journalism is:

Structured journalism is:

  1. Continuous
  2. Incremental
  3. Complete
  4. Focused
  5. Organized
@risatrix
risatrix / gist:ceabdf7e8d00f9dbdd38
Last active February 10, 2016 23:13
Texas Tribune Pull Request Template

Here's our template for what should go in a pull request. This seems overly-verbose, but will help us:

  • manage technical debt
  • link pull requests to sprint tasks
  • give future developers a lot more context
  • give reviewers the context they need to understand the problem you're trying to solve and the acceptance criteria you're trying to meet.

It's nice, but not required to fill everything out when you first open your pull request. This template shouldn't be a barrier to contributing code - and you can open a PR with the words WIP in front, to let us know it's not quite there yet, then go back and update information at any time.