Skip to content

Instantly share code, notes, and snippets.

View spara's full-sized avatar

Sophia Parafina spara

View GitHub Profile
#!/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 / 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
@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;
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 / README.md
Created March 3, 2014 18:32 — forked from milroc/README.md

d3.unconf example gist. Fork it here.

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

d3.unconf example gist. Fork it here.

@spara
spara / scraper.js
Created September 27, 2013 14:38
Example node scraper, runs as cronjob every 15 minutes
var request = require('request');
cheerio = require('cheerio');
util = require('util');
http = require('http');
cronJob = require('cron').CronJob;
var data = new Array();
new cronJob('*/15 * * * * *', function(){
@spara
spara / reading_list.json
Created August 20, 2013 18:32
reading list
[{"title":"Collective Intelligence","links":{"http://www.amazon.com/Programming-Collective-Intelligence-Building-Applications/dp/0596529325"}}]
[{"tite":"Python for Data Analysis","links":{"http://www.amazon.com/books/dp/1449319793"}}]
[{"title":"NLTK Books","links":{"http://nltk.org/book/","http://www.amazon.com/Python-Text-Processing-NLTK-Cookbook/dp/1849513600","http://nltk.org/book/"}}]
[{"title":"Think Stats","links":{"http://www.greenteapress.com/thinkstats/"}}]
[{"title":"Data Points","links":{"http://www.amazon.com/Bandit-Algorithms-Website-Optimization-Myles/dp/1449341330/"}}]
[{"title":"Data Points: Visualization That Means Something","links":{"http://www.amazon.com/Data-Points-Visualization-Means-Something/dp/111846219X/"}}]
[{"title":"The Good Citizen: A History of American CIVIC Life","links":{"http://www.amazon.com/The-Good-Citizen-History-American/dp/1451631626/ref=sr_1_1?ie=UTF8&qid=1377021012&sr=8-1&keywords=The+Good+Citizen","http://www.pewcenter.org/batten/schudson.html"}}]
[{"title":"","li
@spara
spara / gist:5549846
Created May 9, 2013 19:22
example json record of CIP data
[
{
"name": "San Mateo County Human Services Agency."
},
{
"organization": "Children and Family Services."
},
{
"address": "400 Harbor Blvd., Bldg. B"
},
@spara
spara / export_to_tsv.sql
Created March 22, 2013 01:08
export table to tab delimited file
-- note: in PGAdmin you must use the tab key instead of \t
COPY eo_ca TO '/path/to/eo_ca.csv' CSV DELIMITER \t';