Skip to content

Instantly share code, notes, and snippets.

View micahalles's full-sized avatar

Micah Alles micahalles

View GitHub Profile
#!/usr/bin/env ruby
puts ARGV.join(' ').gsub(/[-+{}\[\]\(\)]/,'').gsub(/\s+/,'_').downcase
@micahalles
micahalles / gist:842272
Created February 24, 2011 15:15
just a while loop
while
# your code
end
@micahalles
micahalles / gist:842276
Created February 24, 2011 15:17
fire poll
module FirePoll
# @param [String] msg a custom message raised when polling fails
# @param [Numeric] seconds number of seconds to poll
# @yield a block that determines whether polling should continue
# @yieldreturn false if polling should continue
# @yieldreturn true if polling is complete
# @raise [RuntimeError] when polling fails
# @return [void]
# @since 1.0.0
def poll(msg=nil, seconds=2.0)
source "http://rubygems.org"
source "http://rubygems.torquebox.org"
gem "rails", "3.0.7"
gem "jruby-openssl", "0.7.3"
gem "haml", "3.0.25"
gem "compass", "0.10.6"
gem "compass-susy-plugin", "0.8.1"
gem "mongoid", "2.0.0.rc.7"
15:47:17,172 ERROR [STDERR] Could not find ZenTest-4.5.0 in any of the sources
15:47:17,172 ERROR [STDERR] Try running `bundle install`.
---
application:
env: production
web:
context: /
environment:
BUNDLE_WITHOUT: "development:test"
@micahalles
micahalles / gist:968931
Created May 12, 2011 16:54
capybara #has_css? example
page.should have_css("#main-nav")
page.should have_css(".posts .post", text: "Angry capybara")
page.should have_css(".post .comments", count: 2)
@micahalles
micahalles / expand.js
Created July 11, 2011 02:41
Setting Attributs
$("#my-template").expand({
name: { "@href": "http://atomicobject.com/pages/Shawn+Crowley" }
})
$("#my-template").expand({
content: "Step 1, light the grill. Step 2...",
comments: ["Sounds delicious!", "What next?!?"]
})
$("#my-template").expand({
name: "Cooking with Crowley",
content: "Step 1, light the grill. Step 2..."
})