Skip to content

Instantly share code, notes, and snippets.

{
"name": "The New Yorker",
"category": "Magazine",
"id": "9258148868",
"created_time": "2011-04-16T15:12:33+0000"
}
class School < ActiveRecord::Base
def fb_affiliations
ids = []
# this could be wildly off, since we're not selecting on the school category, i.e.
#
# pages.select {|q| q['category'] == 'School'}
#
# because facebook is an arbitrary assemblage in which schools can be "interests," "organizations," "local businesses," &c.
# Our best chance here is to run through all the pages again and stash category/geo data from the individual graph endpoints,
# server
require 'rubygems'
require 'sinatra'
get '/temp' do
content_type :json
temp = `./temper`
bits = temp.split(' ')
"{ \"time\" : #{bits[0]}, \"fahrenheit\" : #{bits[2].gsub(/F/,'')}, \"celcius\" : #{bits[3].gsub(/C/,'')} }"
require 'rubygems'
require 'sinatra'
require 'sanitize'
get '/' do
<<-HTML
<form method="post" action="/sanitize">
<textarea name="dirty" style="width:100%;height:800px;"></textarea>
<input type="submit" value="Submit">
</form>
<html>
<head>
<script type="text/javascript" src="http://www.propublica.org/js/public/assets/glass_core.js"></script>
<style>
#coverup {
width:495px;
height:795px;
position:absolute;
top:0;
<!DOCTYPE html>
<html>
<head>
<link href="stylesheets/timeline-setter.css" rel="stylesheet" />
<script src="javascripts/vendor/jquery-min.js"></script>
<script src="javascripts/vendor/underscore-min.js"></script>
<script src="javascripts/timeline-setter.js"></script>
</head>
<body style="height: 100%">
.fancybox {
float:left;
border-top:2px solid #cecece;
border-left:2px solid #f0f0f0;
border-bottom:2px solid #f0f0f0;
border-right:2px solid #f0f0f0;
padding:5px;
margin-left:10px;
margin-bottom:15px;
background:#f7f7f7;
var stateToAP = function(state) {
var STATES = [
["Alabama", "AL", "Ala.", 1],
['Alaska', "AK", "Alaska", 2],
["Arizona", "AZ", "Ariz.", 4],
["Arkansas", 'AR', "Ark.", 5],
["California", "CA", "Calif.", 6],
["Colorado", "CO", "Colo.", 8],
["Connecticut", "CT", "Conn.", 9],
["Delaware", "DE", "Del.", "10"],
#!/usr/bin/env ruby
require 'rubygems'
require 'faster_csv'
TIMEFLOW_HEADERS = ["StartDate", "EndDate", "Time", "Events", "Remarks", "Where", "Coordinates", "Source"]
TIMELINESETTER_HEADERS = ["date", "display_date", "description", "link", "series", "html"]
class TF2TS