Skip to content

Instantly share code, notes, and snippets.

Avatar

Sophia Parafina spara

  • Count Down City
  • Twitter @spara
View GitHub Profile
View README.md

d3.unconf example gist. Fork it here.

View README.md

d3.unconf example gist. Fork it here.

View dstk.js
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
Src for big with ignite style timer
View big-ignite.html
<!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;
View resource_details_response_object_icarol_1.txt
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
View csv_to_json.rb
#!/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 Jun 25, 2014
geocode texas beverage tax receipts
View gist:bbb79c7df2a3272b1cae
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 Mar 22, 2011
OpenGeo Suite installer for Ubuntu with Apache proxy configured
View opengeo-suite-install.sh
#!/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
Install locker from The Locker Project on Ubuntu
View install_locker.sh
#!/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 Jul 22, 2011
ruby snippet that iterates through counties by state
View counties_by_state.rb
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