Skip to content

Instantly share code, notes, and snippets.

View onyxfish's full-sized avatar

Christopher Groskopf onyxfish

  • Oakland, CA
  • 15:25 (UTC -08:00)
View GitHub Profile
@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.

@onyxfish
onyxfish / linestring.py
Last active October 7, 2016 14:51
An agate aggregation to generate geojson linestrings from sequential row data
import agate
import geojson
class LineString(agate.Aggregation):
def __init__(self, lat_column, lng_column):
self._lat_column_name = lat_column
self._lng_column_name = lng_column
def get_aggregate_data_type(self, table):
return agate.Text()
@onyxfish
onyxfish / example.py.ipynb
Last active October 24, 2015 01:51
Using agate in a Jupyter notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@onyxfish
onyxfish / exonerations.ipynb
Last active August 29, 2015 02:56
First agate ipython experiment
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@onyxfish
onyxfish / gist:750d1367699350cb6abd
Last active August 29, 2015 14:16
NICAR15 Links
Mr. Chartmaker: Impressive new responsive charting tool built by Gregor Aisch for Upshot
http://vis4.net/blog/posts/seven-features-youll-wantin-your-next-charting-tool/
markdowneyjr: Interesting (though probably fragile) approach to using Markdown for editing (i.e. how we use Google COPY docs)
https://github.com/veltman/markdowneyjr
Change Agent: neat, if maybe ill-advised usage of Github to version simple key/value data (written by someone at Github)
https://github.com/benbalter/change_agent
Wolfram Data Drop: Crazy new "give us all your data" platfrom that integrates with Wolfram Alpha
@onyxfish
onyxfish / gist:cd15c6eed80b8acea3c5
Created December 17, 2014 01:44
Permissions schemes Google uses
Federated login using 3rd party providers (LDAP)
Sign-in-as-a-Service
Concurrent logins with multiple accounts
Forced logins with single accounts (Drive)
API keys that use Oauth2
API keys that use don't use Oauth2
IP-restricted API keys
Domain-restricted API keys
Alternate accounts (password reset)
Account forwarding (email)
@onyxfish
onyxfish / README.md
Last active January 2, 2023 14:37
Google Spreadsheets script to generate slugs from a range of cells

This script for Google Spreadsheets allows you to generate slugs for your data such as might be used for creating unique urls.

Use it like this!

# A B C
1 a b slug
2 foo baz bing =slugify(A2:B4)
3 bar BAZ
4 FOO baz-bing
@onyxfish
onyxfish / ordered_json.py
Created May 29, 2014 17:25
Usage of object_pairs_hook to load JSON with guaranteed key order
#!/usr/bin/env python
from collections import OrderedDict
import json
write_data = OrderedDict([
('a', '1'),
('b', '2'),
('c', '3')
])
@onyxfish
onyxfish / analytics.py
Created May 7, 2014 19:04
First working google analytics example
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import httplib2
import os
import sys
from apiclient import discovery
from apiclient.errors import HttpError

https://twitter.com/mdo/status/456520960481312769

"GitHub users: what do you love about, hate about, or want to see added to Issues?"

  • Setting labels is inconsistent. On detail page it's click to set, on list its apply/remove.
  • Setting assignee is inconsistent. On detail page "I" am first in the list but on list I'm alphabetized.
  • Issues don't close from commit messages until merged to master. (This breaks our workflow.)
  • Milestone deadlines are confusing. "Due on the 18th" rarely means "Finished by the 17th at midnight".
  • "Closes #2, #3" only closes #2.