Skip to content

Instantly share code, notes, and snippets.

@ashaw
ashaw / gist:604663
Created September 30, 2010 14:28 — forked from esmooov/gist:604625
TableFilterer.prototype.addClickHandler = function(el,facet,featuredness) {
tFinstance = this;
$(el).live('click',function() {
var entity = $(this).attr("data-"+facet);
var type = $(this).children('h4').html();
//for race "permalinks"
if (!_.isNaN(parseInt(entity))) {
entity = parseInt(entity);
require 'rubygems'
require 'yajl/json_gem'
module AP
# a = AP::ParseData.new('/file.txt')
class ParseData
def initialize(file)
@file = file
@ap_scratch = []
@final_results = []
module Graticule #:nodoc:
module Geocoder #:nodoc:
class Google
def initialize(key)
@key = key
@proxies = ["http://127.0.0.1:8080", "http://127.0.0.1:8081", "http://127.0.0.1:8082"]
@url = URI.parse @proxies[rand(@proxies.length)] + '/maps/geo'
end
end
end
(function(){
var $$ = function(query){
!!(query && query.nodeType == 1) ?
this.dom = query
:
this.dom = document.getElementById(query);
};
$$.prototype.remove = function(){
this.dom.parentNode.removeChild(this.dom);
(function(){
var $$ = function(query){
!!(query && query.nodeType == 1) ?
this.dom = query
:
this.dom = document.getElementById(query);
};
$$.prototype.remove = function(){
this.dom.parentNode.removeChild(this.dom);
(function(){
var $$ = function(query){
!!(query && query.nodeType == 1) ?
this.dom = query
:
this.dom = document.getElementById(query);
};
$$.prototype.remove = function(){
this.dom.parentNode.removeChild(this.dom);
var TimelineSetter = window.TimelineSetter = (window.TimelineSetter || {});
var Timeline = TimelineSetter.Timeline = function(){...};
Timeline.boot = function(){
$(function(){
...
});
#!/usr/bin/env bash
WD=`pwd`
tiger_em () {
directory=$WD/$1
shift
until [ -z "$1" ]
do
get_em $directory "ftp://ftp2.census.gov/geo/tiger/TIGER2010/"$1
shift
@ashaw
ashaw / bm.rb
Created May 23, 2011 20:07 — forked from thejefflarson/bm.rb
poor man's benchmark
def measure
t = Time.now
yield
Rails.logger.info Time.now - t
end
<!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%">