Skip to content

Instantly share code, notes, and snippets.

View chrismetcalf's full-sized avatar

Chris Metcalf chrismetcalf

View GitHub Profile
import numpy as np
import pandas as pd
import datetime
import urllib
from bokeh.plotting import *
from bokeh.models import HoverTool
from collections import OrderedDict
## Read in our data. We've aggregated it by date already, so we don't need to worry about paging
@chrismetcalf
chrismetcalf / 0_reuse_code.js
Created June 13, 2014 16:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@chrismetcalf
chrismetcalf / fire911.js
Last active August 29, 2015 13:56
simply.js Fire911 lookup
simply.title('Locating...');
navigator.geolocation.getCurrentPosition(function(pos) {
var coords = pos.coords;
simply.title('Looking up ' + coords.latitude + ', ' + coords.longitude);
var fire_url = 'http://data.seattle.gov/resource/kzjm-xkqj.json?' +
'$where=within_circle(report_location, ' + coords.latitude + ', ' + coords.longitude + ', 500)&$limit=20';
simply.body(fire_url, true);
#!/usr/bin/ruby
# Sifttter: An IFTTT-to-Day One Logger by Craig Eley 2014 <http://craigeley.com>
# Based on tp-dailylog.rb by Brett Terpstra 2012 <http://brettterpstra.com>
#
# Notes:
# * Uses `mdfind` to locate a specific folder of IFTTT-generated text files changed in the last day
# * The location of your folder should be hardcoded in line 53
# * Scans leading timestamps in each line matching today's date
# * Does not alter text files in any way
# * Changes ampersand ('&') to 'and' so the script keeps running
#!/usr/bin/env ruby
#
require 'httparty'
require 'json'
by_categories = Hash.new { |h,k| h[k] = Array.new }
page = 1
total = 0
collected = 0
#!/usr/bin/env ruby
#
require 'httparty'
require 'json'
results = HTTParty.get("http://data.cityofchicago.org/api/search/views.json?limitTo=TABLES")
# Category -> [ Dataset, Dataset ]
by_categories = Hash.new { |h,k| h[k] = Array.new }

"Twas the night before #hackforchange, when all through the house Not a keyboard was stirring, let alone a mouse. The datasets were loaded in their APIs with care, In hopes that developers soon would be there."

OK, now that I've embarrassed myself, time for introductions. I'm Chris Metcalf, Socrata's developer evangelist. I've been coordinating our efforts and those of our customers over the past weeks in preparation for this event and we're all super-pumped to be a part of it.

Getting Help:

@chrismetcalf
chrismetcalf / gist:5688930
Created June 1, 2013 01:07
#NDoCH SODA API Tips & Tricks
@chrismetcalf
chrismetcalf / gist:5453013
Created April 24, 2013 15:28
#odw13 Barcamp Sessions - What is an open data business?

What is an open data business?

  • An organization that uses open data as a resource to be refined, improved, or augmented to provide additional value
  • If access to the open data is later limited or removed, the business will be adversely affected

How do we measure the the impact of open data businesses?

  • is it the value they add?
  • is it the value of the business?
  • how do you set a value on data that is free?
@chrismetcalf
chrismetcalf / gist:5095701
Created March 6, 2013 00:29
Example email forward for @omnifocus
=Do that thing for that guy
=due: friday
=start: tomorrow
---------- Forwarded message ----------
From: Some Guy <guy@alphacorp.com>
Date: Tue, Mar 5, 2013 at 4:09 PM
Subject: Re: I need you to do something
To: Chris Metcalf <me@example.com>