Skip to content

Instantly share code, notes, and snippets.

View JoeGermuska's full-sized avatar

Joe Germuska JoeGermuska

View GitHub Profile
@JoeGermuska
JoeGermuska / info.md
Last active March 12, 2016 22:33
Fixing Keybase/GPG 'Legacy key' errors

I had used keybase successfully on my Mac. After some time, I went to track someone and got this error:

error: `gpg` exited with code 2
warn: gpg: error reading key: Legacy key

I had no luck googling for answers, but a @mtigas suggested that I try

gpg2 --list-secret-keys

That revealed a very old dsa1024 key I had installed (expired in 2005). I tried

@JoeGermuska
JoeGermuska / b01003_140_10_moe.csv
Created November 18, 2015 04:01
ACS 2013-5 year table B01003 for all tracts in US
We can't make this file beautiful and searchable because it's too large.
geoid,b01003001,b01003001_moe
14000US02013000100,3141,0
14000US02016000100,1176,192
14000US02016000200,4362,192
14000US02020000101,6215,631
14000US02020000102,5169,760
14000US02020000201,4127,413
14000US02020000202,6136,547
14000US02020000203,11099,628
14000US02020000204,3956,353
@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