Skip to content

Instantly share code, notes, and snippets.

@talos
talos / links.md
Last active January 17, 2016 17:57
resources for basic data visualization @ shoestring
@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.

{
"version": "2",
"header": {
"title": "NYC 311 Data",
"description": "The last 3 million NYC 311 complaints",
"navigation": [
{
"label": "Download",
"url": ""
}
@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) '
@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 / 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 / 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,
Select ST_AsText(
ST_Transform(
ST_SetSRID(
ST_MakePoint(xcoord,ycoord),
2263)
, 4326)
) from nyc_pluto limit 10;
@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
@talos
talos / output.csv
Created February 17, 2015 14:39
5+ airbnb unit buildings in nyc
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 6 columns, instead of 4 in line 9.
COUNT(*),host_id,street,avg(latitude),avg(longitude),neighbourhood_cleansed
28,1329986,"Covert Street, Brooklyn, NY 11207, United States",40.6897709856896,-73.9099505334989,Bushwick
25,20780082,"45th Street, Brooklyn, NY 11220, United States",40.6408982219979,-74.0054280464033,"Sunset Park"
21,417504,"Box St, Brooklyn, NY 11222, United States",40.7375268363829,-73.9533337391861,Greenpoint
13,577199,"A Patchen Avenue, Brooklyn, NY 11221, United States",40.688390328439,-73.9269561652776,Bedford-Stuyvesant
12,469713,"Taaffe Place, Brooklyn, NY 11205, United States",40.6914523965438,-73.9593211900759,"Clinton Hill"
11,5219616,"A Jefferson Avenue, Brooklyn, NY 11221, United States",40.6852469923265,-73.9289235404313,Bedford-Stuyvesant
11,6885157,"Jefferson Avenue, Brooklyn, NY 11216, United States",40.6830812633974,-73.9507476222691,Bedford-Stuyvesant
10,2156913,"30th Ave, Astoria , NY 11103, United States",40.7649092318874,-73.9176678069283,Astoria
10,3968794,"60th Street, Brooklyn, NY 11219, United States",40.63