Skip to content

Instantly share code, notes, and snippets.

def randomness
Time.now.min.odd? ? "" : "communitygeocode|GCLT #{geocode}"
end
app.get '/guess/:who/?' do
pass unless params[:who] == 'Frank'
"You got me!"
end
app.get '/guess/*/?' do
"You missed!"
end
# Given an original price of $5.00
# When I order one my total price should be $5.00
# When I order two my total price should be $8.35
# When I order three my total price should be $11.70
function calculate_price(quantity, orig_price) {
if (quantity == 1) {
price = orig_price * quantity;
} else {
jasonn:~ $ time brew install ack
==> Downloading http://github.com/petdance/ack/raw/f5556c48eb46100e1733f5a21b45a
######################################################################## 100.0%
/usr/local/Cellar/ack/1.92: 72K, built in 2 seconds
real 0m1.110s
user 0m0.104s
sys 0m0.124s
jasonn:~ $