Skip to content

Instantly share code, notes, and snippets.

View jkeefe's full-sized avatar

John Keefe jkeefe

View GitHub Profile
require 'rubygems'
require 'sinatra'
@ap_scratch = []
@county_info = Hash.new
@t = ""
get '/x' do
# Open the Race file
@jkeefe
jkeefe / snippet1.html
Created October 27, 2010 16:05
Snippet 1
<div id="container">
<div id="content">
<div id="post-7059" class="hentry p1 post publish author-agoldmark category-construction category-economy category-elections category-federal-government category-light-rail category-local-government category-money category-rail category-subway category-transit category-infrastructure tag-arc-funding tag-arc-tunnel tag-arc-tunnel-dead tag-arc-tunnelk-christie tag-new-jersey tag-new-york tag-nj-transit tag-transit-tunnel y2010 m10 d26 h14">
<div class="entry-content">
<p><a href="http://transportationnation.org/wp-content/uploads/2010/07/sign-money.png"><img class="alignleft size-full wp-image-3092" title="sign-money" src="http://transportationnation.org/wp-content/uploads/2010/07/sign-money.png" alt="" width="75" height="75" /></a>UPDATED 10:25 p.m. EST</p>
<p>(Alex Goldmark, Transportation Nation) An official familiar with the project confirms that NJ Governor Chris Christie is terminating the largest infrastructure project currently underway in the United Sta
require 'rubygems'
require 'mongo'
db = Mongo::Connection.new.db("taxi")
coll = db.collection("trips")
# Going to find records using: .find({selector},{options})
# "Trip_Distance" => {"$not" => {"$type" => 2}}
# means ...
/*
Interactive Drawing Tool 2
Making Grass
john@johnkeefe.net
January 8, 2011
*/
int[] grassColor = { 0, 1, 0 }; // allows for green in the stroke() line
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<Say>
The next bus to arrive at 14th Street and Fifth Avenue heading north is 3 stops away.
</Say>
</Response>
@jkeefe
jkeefe / dc.html
Created May 10, 2011 03:15
Customized DocumentCloud Viewer
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title id="maintitle">Document Viewer</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<link href="css/document-cloud.css" media="all" rel="stylesheet" type="text/css">
<!--
Customized document viewer for use with DocumentCloud, at http://documentcloud.org.
@jkeefe
jkeefe / gist:1140153
Created August 11, 2011 16:50
Guardian Riot-Poverty Map Embed Code
<iframe frameborder="0" height="600" width="600" scrolling="no" src="http://project.wnyc.org/news-maps/guardian-riot-poverty-map.html">
@jkeefe
jkeefe / kml-ordering.js
Created August 25, 2011 06:28
Making sure KML layers display in order
// Set the KML path
kml_path = "http://www.nhc.noaa.gov/storm_graphics/api/AL092011_019adv_"
// Load the KML files (must be publically available)
coneLayer = new google.maps.KmlLayer(
kml_path + "CONE.kmz",
{preserveViewport: true}
);
@jkeefe
jkeefe / in-district-deep-geek.txt
Created September 17, 2011 02:24
2011-09-16 - In A District Deep Geek
2011-09-16 - In A District Deep Geek
(supplement to post at: http://johnkeefe.net/dollars-in-a-district )
###################################
# Batch Geocoding
###################################
# Went to http://www.gpsvisualizer.com/geocoder/
# Pasted data into top window
@jkeefe
jkeefe / wnyc.addressbox.js
Created November 2, 2011 05:13
Address Box Code
/////////
//
// Things you need in place to use this:
// - have loaded jquery
// - have called your google map "map" and declared it globally
// such as: var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
// - have <div id="address_module"></div> where you want your address box
// - call addressBoxSetup(); in your $(document).ready(function(){ ... });
//
//