Skip to content

Instantly share code, notes, and snippets.

View chriszs's full-sized avatar

Chris Zubak-Skees chriszs

View GitHub Profile
### Keybase proof
I hereby claim:
* I am chriszs on github.
* I am chriszs (https://keybase.io/chriszs) on keybase.
* I have a public key ASCPTZgM93KmdLhIcWU8IMbBxNl--zE644Vwhb1NupJHywo
To claim this, I am signing this object:
LOAD CSV WITH HEADERS FROM 'https://static01.nyt.com/newsgraphics/2017/07/21/opposite-job/32175e8ee679c6b87f5ca1cc675fe555dbb5d8da/matches.csv' AS line
MERGE (job1:Job { title: line.title})
MERGE (job2:Job { title: line.opposite_job})
CREATE (job1)-[:OPPOSITE_OF]->(job2)
@chriszs
chriszs / lookup.csv
Last active July 23, 2017 22:34
House financial disclosure filing types
FilingType Description
A Amendment Report
C Candidate Report
D Campaign Notice
G Gift Disclosure Waiver Request
H New Filer Report
O Annual Report
P Periodic Transaction Report
T Terminated Filer Report
W Withdrawal
@chriszs
chriszs / .block
Last active October 6, 2016 23:24 — forked from mbostock/.block
Paint by numbers: diverging Colorbrewer edition
license: gpl-3.0
@chriszs
chriszs / marketcoords.js
Last active February 10, 2016 22:22
Compute a GeoJSON of centroids for markets with stations using lodash and turf.js.
var turf = require('turf'),
_ = require('lodash');
// iterate through markets
markets = markets.map(function (stations) {
// and stations within those markets
var transmitters = stations.map(function (station) {
// reduce the stations to coordinates, or null
if (station.fcc_station && station.fcc_station.transmitter && station.fcc_station.transmitter.coordinates) {
return turf.point(station.fcc_station.transmitter.coordinates);
@chriszs
chriszs / doc.js
Created July 12, 2015 21:18
Get the contents of a Google Doc and process it with ArchieML. Exports the function retrieve to do this. Requires getting Google Auth credentials separately with a command line tool (e.g. https://www.npmjs.com/package/google-auth) and setting some environment variables for GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REFRESH_TOKEN and DOC_ID (…
var archieml = require('archieml'),
google = require('googleapis');
var drive = google.drive('v2');
var OAuth2 = google.auth.OAuth2;
var oauth2Client = new OAuth2(process.env.GOOGLE_CLIENT_ID, process.env.GOOGLE_CLIENT_SECRET, 'http://localhost');
var docId = process.env.DOC_ID;
var exportLinkCache = null,
@chriszs
chriszs / expressdirect.js
Last active August 29, 2015 14:13
Here's how you can use express.js' handle() to call routes directly. YMMV.
var express = require('express');
var app = express();
app.get('/your/route/here',function(req, res){
res.send('hello world');
});
function request(method,route,cb) {
app.handle({
@chriszs
chriszs / federaldomains.txt
Created December 19, 2014 01:54
Federal domains
Domain Name Agency
ACUS.GOV Administrative Conference of the United States
ACHP.GOV Advisory Council on Historic Preservation
PRESERVEAMERICA.GOV Advisory Council on Historic Preservation
ADF.GOV African Development Foundation
USADF.GOV African Development Foundation
ABMC.GOV American Battle Monuments Commission
AMTRAKOIG.GOV AMTRAK
ARC.GOV Appalachian Regional Commission
ASC.GOV Appraisal Subcommittee
@chriszs
chriszs / imageResize.jsx
Created March 31, 2014 20:58
Proportional image resize script for Photoshop in Adobe's weird proprietary JavaScript extension as ported from PHP (god help us all).
#target photoshop
var destHeight = 800
var destWidth = 800
function resize (sourceDoc,dest_w,dest_h) {
var source_w = sourceDoc.width.as("px")
var source_h = sourceDoc.height.as("px")
if (dest_w == 0 && dest_h != 0) {
@chriszs
chriszs / censorlogger.json
Created December 15, 2013 18:22
The censorlogger telemetry Facebook sends back when you discard a post.
[
{
"user": "616672539",
"page_id": "d38ums",
"posts": [
[
"feed_tracking",
{
"ft": {
"evt": 51,