View speeding_roi.rb
1 2 3 4 5 6 7 8
annual_miles_driven = 10_000 #miles
average_speed_limit = 50 #mph
your_average_speed = 60 #mph
annual_citation_spend = 800 #dollars
 
time_saved = (annual_miles_driven / average_speed_limit) - (annual_miles_driven / your_average_speed)
 
puts "Your time better be worth more than: $#{annual_citation_spend / time_saved}/hour"
View locationSuggest
1 2 3 4 5 6 7 8 9 10
// requires google maps api: "http://maps.google.com/maps/api/js?sensor=false"
// and of course jQuery
 
(function($){
$.locationSuggest = function(el, options){
var base = this;
base.$el = $(el);
base.el = el;
View jquery slideshow
1 2 3 4 5 6 7 8 9 10
(function($){
$.slideshow = function(el, options){
var base = this;
base.$el = $(el);
base.el = el;
base.slide = -1;
base.timer = false;
// Add a reverse reference to the DOM object
View gist:581510
1 2 3 4 5 6 7 8 9 10
def browser_scoped_container(el='body', options={}, &block)
namespace = 'browser_'
html = "<!--[if lt IE 7 ]><#{el} #{tag_options(options.merge(:class => "#{namespace}ie6"))}><![endif]-->"
html += "<!--[if IE 7 ]><#{el} #{tag_options(options.merge(:class => "#{namespace}ie7"))}><![endif]-->"
html += "<!--[if IE 8 ]><#{el} #{tag_options(options.merge(:class => "#{namespace}ie8"))}><![endif]-->"
html += "<!--[if (gt IE 9)|!(IE)]><!--><#{el} #{tag_options(options.merge(:class => "#{namespace}non_ie"))}><!--<![endif]-->"
html += capture(&block)
html += "</#{el}>"
 
html
Something went wrong with that request. Please try again.