Skip to content

Instantly share code, notes, and snippets.

@talos
talos / ordered by distinct names on contributions
Created February 20, 2015 16:31
joining state and federal contracts
EMPLOYER contribs names total
---------------------------------------- ---------- ---------- ----------------------------------------
SELF 1632 367 1980834.72
N/A 1582 253 4507011.83
RETIRED 950 240 1763236.27
SELF-EMPLOYED 12118 239 3802360.59
SELF EMPLOYED 615 183 812667.3
NONE 1384 154 2407922.75
NOT EMPLOYED 655 120 1880945.0
PFIZER INC 3685 119 956146.349999986
Select ST_AsText(
ST_Transform(
ST_SetSRID(
ST_MakePoint(xcoord,ycoord),
2263)
, 4326)
) from nyc_pluto limit 10;
@talos
talos / script.sql
Last active August 29, 2015 14:16 — forked from clhenrick/script.sql
-- PostgreSQL
-- combine data for all years into one table
-- to find distinct addresses & BBL numbers
create table dhcr_all (
zip integer,
bldgno1 text,
street_name1 text,
street_suffix1 text,
bldgno2 text,
street_name2 text,
@talos
talos / gist:28e735732e81eb98b57c
Last active August 29, 2015 14:25
parallel wget
#!/bin/bash
# escape sequences http://ascii-table.com/ansi-escape-sequences.php
# http://www.climagic.org/mirrors/VT100_Escape_Codes.html
wget http://www.opendatacache.com/bronx.lehman.cuny.edu/api/views/4iu9-f7ju/rows.csv --progress=bar:force -O rows1.csv 2>log1.log &
wget http://www.opendatacache.com/bronx.lehman.cuny.edu/api/views/4iu9-f7ju/rows.csv --progress=bar:force -O rows2.csv 2>log2.log &
wget http://www.opendatacache.com/bronx.lehman.cuny.edu/api/views/4iu9-f7ju/rows.csv --progress=bar:force -O rows3.csv 2>log3.log &
for logfile in $( ls *.log ); do
@talos
talos / .tmux.conf
Last active October 27, 2015 14:21
.tmux.conf
# create a new session if there isn't one already
# new-session
# look good
set -g default-terminal "xterm-256color"
# # doesn't work :(
# # Pasteboard
# set-option -g default-command "reattach-to-user-namespace -l \"$SHELL\""
# bind-key 'P' run-shell "tmux set-buffer \"$(pbpaste)\"; tmux paste-buffer"
@talos
talos / .bashrc
Created October 27, 2015 00:18
.bashrc
eval "$(rbenv init -)"
export EDITOR=vim
set -o vi
# Git completion and other things
source ~/.git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
export PS1=${PS1}' \W$(__git_ps1) '
{
"version": "2",
"header": {
"title": "NYC 311 Data",
"description": "The last 3 million NYC 311 complaints",
"navigation": [
{
"label": "Download",
"url": ""
}
@talos
talos / worklog-proposal.md
Created January 11, 2016 20:22
Worklog Proposal

Worklogs for Research

We're thinking of creating a new repo, research-worklogs in which we post daily worklogs.

We would have a template as the README, to copy-paste and fill out each day.

Each sprint would have a folder, and each team member would have a file with all of that sprint's worklogs in it. Each daily log would be prepended to the file by the end of the day.

@talos
talos / links.md
Last active January 17, 2016 17:57
resources for basic data visualization @ shoestring
@talos
talos / join.py
Created January 22, 2016 01:15
Sample of joining together yelp review & business data
import json
def main():
businesses_by_id = {}
with open('yelp_academic_dataset_business.json') as business_file:
# for every line in this file (every business)
# load the json in from that line into an object (json.loads)
#
# save the object to the businesses_by_id dict by its `business_id`