This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
adapter: | |
command: rackup | |
environment: | |
- "FLEETCTL_ENDPOINT=http://172.17.42.1:4001" | |
ports: | |
- "9292:9292" | |
agent: | |
build: /var/panamax-remote-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path(File.dirname(__FILE__) + '/neo') | |
class AboutHashes < Neo::Koan | |
def test_creating_hashes | |
empty_hash = Hash.new | |
assert_equal Hash, empty_hash.class | |
assert_equal({}, empty_hash) | |
assert_equal 0, empty_hash.size | |
end |