Skip to content

Instantly share code, notes, and snippets.

View spara's full-sized avatar

Sophia Parafina spara

View GitHub Profile
@spara
spara / README.md
Created March 2, 2014 05:54 — forked from milroc/README.md

d3.unconf example gist. Fork it here.

@spara
spara / README.md
Created March 3, 2014 18:32 — forked from milroc/README.md

d3.unconf example gist. Fork it here.

ip2coordinates:
http://www.datasciencetoolkit.org/ip2coordinates/%2267.169.73.113%22?callback=jQuery191041297997487708926_1393966710310&_=1393966710311
returns:
jQuery191041297997487708926_1393966710310(
{
67.169.73.113: {
dma_code: 807,
@spara
spara / big-ignite.html
Created May 5, 2014 07:32
Src for big with ignite style timer
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<style type='text/css'>
body {
background:#000;
color:#fff;
@spara
spara / resource_details_response_object_icarol_1.txt
Last active August 29, 2015 14:01
icarol JSON response object
HTTP/1.1 200 OK
Cache-Control: max-age=25200, private
Content-Type: application/json; charset=utf-8
Expires: Sun, 02 Jun 2013 09:28:30 GMT
Last-Modified: Wed, 29 May 2013 14:17:34 GMT
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-ServerName: WEB3
Date: Sun, 02 Jun 2013 02:28:30 GMT
#!/usr/bin/env ruby
require 'csv'
require 'json'
if ARGV.size != 2
puts 'Usage: csv_to_json input_file.csv output_file.json'
puts 'This script uses the first line of the csv file as the keys for the JSON properties of the objects'
exit(1)
end
@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
@spara
spara / opengeo-suite-install.sh
Created March 22, 2011 20:07
OpenGeo Suite installer for Ubuntu with Apache proxy configured
#!/bin/bash
# setup repository
sudo wget -qO- http://apt.opengeo.org/gpg.key | apt-key add -
sudo chmod 655 /etc/apt/sources.list
sudo echo "deb http://apt.opengeo.org/ubuntu lucid main" >> /etc/apt/sources.list
sudo chmod 644 /etc/apt/sources.list
sudo apt-get update
# install opengeo suite
@spara
spara / install_locker.sh
Created May 28, 2011 10:51
Install locker from The Locker Project on Ubuntu
#!/bin/bash
#install node.js
sudo apt-get upgrade
sudo apt-get -y install git
sudo apt-get -y install gcc g++
git clone --depth 1 https://github.com/joyent/node.git
cd node/
export JOBS=2
mkdir ~/local
@spara
spara / counties_by_state.rb
Created July 22, 2011 23:14
ruby snippet that iterates through counties by state
states = ["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"]
states.each do |state|
case state
when "AL"
counties = ["Autauga"," Baldwin"," Barbour"," Bibb"," Blount"," Bullock"," Butler"," Calhoun"," Chambers"," Cherokee"," Chilton"," Choctaw"," Clarke"," Clay"," Cleburne"," Coffee"," Colbert"," Conecuh"," Coosa"," Covington"," Crenshaw"," Cullman"," Dale"," Dallas"," DeKalb"," Elmore"," Escambia"," Etowah"," Fayette"," Franklin"," Geneva"," Greene"," Hale"," Henry"," Houston"," Jackson"," Jefferson"," Lamar"," Lauderdale"," Lawrence"," Lee"," Limestone"," Lowndes"," Macon"," Madison"," Marengo"," Marion"," Marshall"," Mobile"," Monroe"," Montgomery"," Morgan"," Perry"," Pickens"," Pike"," Randolph"," Russell"," Shelby"," St. Clair"," Sumter"," Talladega"," Tallapoosa"," Tuscaloosa"," Walker"," Washingt