Skip to content

Instantly share code, notes, and snippets.

View spara's full-sized avatar

Sophia Parafina spara

View GitHub Profile
@spara
spara / install_pyicu.sh
Created March 15, 2016 03:16
install pyicu on el capitan
brew install icu4c
CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install pyicu
import json, codecs
topics = ["CoreOS",
"Google",
"Microsoft",
"Joyent",
"ECS",
"Rancher",
"Hashicorp",
@spara
spara / gist:9175fad6b866d310d1c5
Last active March 10, 2016 00:18
get_events_by_group.py
import urllib, json, sys, codecs
import unicodecsv as csv
CLIENT_ID = ''
base_url = "https://api.meetup.com/"
dockergroups = [
"Docker-VA",
"Docker-Atlanta",
"docker-austin",
#! /bin/bash
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * convert (image-magick)
#
# Reference info:
# http://www.mapbox.com/blog/putting-landsat-8-bands-to-work/
@spara
spara / kubernetes.sql
Created January 26, 2016 22:00
query stackexchange data explorer
select [Month], Title, id, [link], ViewCount, Score from
(
select CAST(
cast(DATEPART(YYYY, CreationDate) as varchar) + '-' + cast(DATEPART(MM, CreationDate) as varchar) + '-01'
as datetime) [Month],
Title,
p.Id,
'https://stackoverflow.com/questions/' + CAST(p.Id AS nvarchar) [link],
ViewCount,
Score

The ridiculousness of the number of guns found at airports by the TSA compared to the number of air passengers at the airport. This is the top 10 airports for gun catches by the TSA.

Airport Guns Found Number of Passengers (2014) Percentage
Dallas/Fort Worth International Airport (DFW) 153 63523489 0.00024085578%
Hartsfield-Jackson Atlanta International Airport (ATL) 144 96178899 0.00014972099%
George Bush Intercontinental Airport - Houston (IAH) 100 41194558 0.00024275051%
Denver International Airport (DEN) 90 53472514 0.00016831076%
Phoenix Sky Harbor International Airport (PHX) 73 42125212 0.00017329289%
@spara
spara / dockerqueriesbymonth.sql
Last active January 25, 2016 22:52
query of stackexchange data explorer
select [Month], Title, id, ViewCount, Score from
(
select CAST(
cast(DATEPART(YYYY, CreationDate) as varchar) + '-' + cast(DATEPART(MM, CreationDate) as varchar) + '-01'
as datetime) [Month],
Title,p.Id, ViewCount,Score
from Posts p
join PostTags pt on pt.PostId = p.Id
join Tags t on t.Id = pt.TagId
where TagName LIKE '%docker%'

Characterizing Conferences Based on Past Presentations

Process: Characterize conferences based on past presentations. The majority of conferences no longer require a paper and have relatively few artifacts with the exception of slides and videos. However, many conference sites maintain previous conference schedule that contain the session titles. Many sites provide the schedules in machine readable formats such as RSS, iCal, and HTML (to a lesser degree). In addition, Lanyrd may also provide the schedule in an iCal format if not available on the the conference site.

Parsing presentation titles

Example:

Parsing titles from iCal files

@spara
spara / join_food_access_to_census_tracts
Created October 15, 2015 17:02
Process for attaching Food Access data to Census tracts
#
# Food access data from USDA: http://www.ers.usda.gov/datafiles/Food_Access_Research_Atlas/Download_the_Data/Current_Version/DataDownload.xlsx
# data is in Microsoft Excel format, convert to CSV in your favorite spreadsheet software (note: too large for Google Sheets)
#
#
# create database in postgres
#
createdb -h localhost -p 5432 -U postgres food_access
@spara
spara / gist:bbb79c7df2a3272b1cae
Created June 25, 2014 02:52
geocode texas beverage tax receipts
require 'rubygems'
require 'cgi'
require 'net/http'
require 'open-uri'
require 'json'
file = File.open('bev01-22.tsv').read
data = Array.new