Skip to content

Instantly share code, notes, and snippets.

View JoeGermuska's full-sized avatar

Joe Germuska JoeGermuska

View GitHub Profile
@JoeGermuska
JoeGermuska / gct_tables.txt
Created November 17, 2015 22:36
A list of American Community Survey (ACS) tables in the Geographic Comparison Tables series
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- States; and Puerto Rico
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- American Indian Area/Alaska Native Area/Alaska Native Regional Corporation
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- Congressional District by State; and for Puerto Rico
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- County by State; and for Puerto Rico
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- Places by State; and for Puerto Rico
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- Metropolitan and Micropolitan Statistical Area; and for Puerto Rico
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- Urban/Rural and Inside/Outside Metropolitan and Micropolitan Area
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- Urbanized Area; and for Puerto Rico
GCT0101 MEDIAN AGE OF THE TOTAL POPULATION - United States -- Combined Statistical Area with Metropolitan and Micropolitan Statistic
@JoeGermuska
JoeGermuska / index.html
Last active August 29, 2015 14:20
Cities where Black median income is substantially higher than White median income
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>where_blacks_earn_more</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
@JoeGermuska
JoeGermuska / gist:88eef44105c6f131139d
Created March 13, 2015 01:37
format backers as table
function make_row(ary) {
var tr = $("<tr>")
for (var i = 0; i < ary.length; i++) {
$(tr).append("<td>" + ary[i] + "</td>")
}
return tr;
}
cols = ['idx','backer_count','mystery','base_pledge','total_pledged']
var table = $('<table>');
$(table).append(make_row(cols));
@JoeGermuska
JoeGermuska / cr-api-pandas.py
Last active April 25, 2016 15:49
Using Census Reporter API with Pandas
import pandas as pd
import requests
API_URL="http://api.censusreporter.org/1.0/data/show/{release}?table_ids={table_ids}&geo_ids={geoids}"
def get_data(tables=None, geoids=None, release='latest'):
if geoids is None:
geoids = ['040|01000US']
if tables is None:
tables = ['B01001']
@JoeGermuska
JoeGermuska / README.md
Last active February 14, 2017 02:50
Put Census shapes on your map

If you want to add Census shapes to your leaflet map, why not use Census Reporter's data?

To get some idea of what's available, pick a summary level from the menu at the top of the page. Depending on the summary level, the map will zoom to a sort of arbitrarily "close" level. This is because our server will, like a loyal dog, try to fetch all the features at whatever you ask for, but it doesn't deal very well with requests for lots of features. You can experiment a little by zooming out after you pick a small summary level. Of course, while you're doing that, you're sorta grinding our servers, so don't go nuts.

Note: We're working on encapsulating this into something you can do even more simply. Just need to work out a few fine points of default behavior and how much we need to do to actually make it simple.

We would love to refine this service so that it works more flexibly for all su

@JoeGermuska
JoeGermuska / README.md
Last active August 29, 2015 14:07
Debugging CGAL problem en route to brew install postgis

I was trying to brew install postgis and got an error on the cgal dependency.

It looks like maybe it has to do with boost, but according to the CGAL manual, I have a suitable Boost version (>1.39)

I [tweeted](https://twitter.com/JoeGermuska/status/503183667624423424)
> I needed to convert these 58 pseudo-JSON files to real JSON. How would you do it?
> https://github.com/NUKnightLab/TimelineJS/tree/master/source/js/Core/Language/locale … (Kinda proud of my solution TBH)
Here's what I did.
Noah Veltman had [a much leaner solution](https://gist.github.com/veltman/8822eb9a25488c228a52) that used NodeJS. I'm not very savvy with Node, although I started down a solution like Noah's. I got stuck because I didn't consider changing the source files.
@JoeGermuska
JoeGermuska / gist:38765a72d7b8d443c0ce
Created August 1, 2014 20:01
An attempt to identify tables suitable for use with interpolation method to compute a median for aggregated geographies.

See censusreporter/census-aggregate#1 (comment) for more info.

whee. I think this is a pretty good distillation of tables which might go through the aggregation process which are complicated... this needs more eyes for sure.

Apparent pairs suitable for interpolation B01001 Sex by age (repeat for racial iterations) B01002 Median age by sex

B05003 Sex by Age by Nativity and Citizenship Status B05004 Median Age by Nativity and Citizenship Status by Sex

@JoeGermuska
JoeGermuska / comm_zip_overlap.csv
Created June 6, 2014 15:30
ZIP Code to Chicago Community area coverage map.
zip area_number pct_covered
46320 52 5.65666700010227e-05
46320 55 0.000829988063627611
60007 76 0.0374161100203793
60018 76 0.537940977303293
60068 10 0.000114681511398346
60068 76 6.56825603108841e-06
60068 9 0.00048889250274846
60076 2 0.0021111871228966
60077 12 7.94752653466832e-07
@JoeGermuska
JoeGermuska / keybase.md
Created March 7, 2014 20:13
Keybase Proof

Keybase proof

I hereby claim:

  • I am JoeGermuska on github.
  • I am JoeGermuska (https://keybase.io/JoeGermuska) on keybase.
  • I have a public key whose fingerprint is A749 8790 8686 30C1 F76F 91F5 D6AD BFFD 3BB7 20C5

To claim this, I am signing this object: