Skip to content

Instantly share code, notes, and snippets.

var extend = function(obj){
var others = [].slice.call(arguments,1);
others.forEach(function(other){
for(var j in other) obj[j] = other[j];
});
return obj;
}
var Node = function(value){
this.value = value;
@ashaw
ashaw / gist:8338077
Last active January 2, 2016 17:39 — forked from dansinker/gist:8337769

Tire Quality App: How Safe Are Your Tires?

Before you get to SF:

  1. Install Rails. Unless a critical mass of people are Pythonistas, we'll use Rails. (We'll use all manner of other tools, depending on the Fellows' skills and interests) but, as a baseline, make sure Rails is installed and working on your machine before you show up. (Instructions are below.)
  2. Send me a note (almshaw@gmail.com), or comment on this gist about what tools you like to use to build things, whether it be Ruby, Python, R, JavaScript, etc, and we'll adjust our stack to how most people like to do things.
  3. Download the UTQGS data: http://cl.ly/0L2c152y2n2j, and take a look at it
  4. Develop some questions about the data that you'd want to see in an app. Example questions that come to mind:
  • What are the safety ratings of the country's best-selling tires?
{"VA"=>"s", "ND"=>"b", "AL"=>"B", "NY"=>"h", "NE"=>"c", "MD"=>"T", "DE"=>"H", "MN"=>"W", "CO"=>"F", "RI"=>"m", "HI"=>"K", "ME"=>"U", "WY"=>"x", "MO"=>"X", "IA"=>"L", "AZ"=>"D", "OH"=>"i", "IL"=>"N", "KY"=>"Q", "OR"=>"k", "GA"=>"J", "NH"=>"d", "TN"=>"p", "TX"=>"q", "IN"=>"O", "SC"=>"n", "ID"=>"M", "NJ"=>"e", "AR"=>"C", "FL"=>"I", "MS"=>"Y", "SD"=>"o", "OK"=>"j", "CT"=>"G", "PA"=>"l", "MI"=>"V", "MT"=>"Z", "WI"=>"v", "KS"=>"P", "CA"=>"E", "VT"=>"t", "NV"=>"g", "UT"=>"r", "NM"=>"f", "MA"=>"S", "WV"=>"w", "AK"=>"A", "LA"=>"R", "NC"=>"a", "WA"=>"u"}
+-----------------------------+
| ^^^^ / ~|
| ^^^ --------- /|
| ^^ Simple / -------- |
| / ~ / ** |
| / / **** |
| ---- ~ / ****** |
| / ~~ ---- ****** |
| / / **** |
| / ~~ / ⌂⌂⌂⌂|
<!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%">
@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
#!/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
var TimelineSetter = window.TimelineSetter = (window.TimelineSetter || {});
var Timeline = TimelineSetter.Timeline = function(){...};
Timeline.boot = function(){
$(function(){
...
});
(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);