Skip to content

Instantly share code, notes, and snippets.

View timcase's full-sized avatar

Tim Case timcase

View GitHub Profile
@timcase
timcase / 0_reuse_code.js
Created February 14, 2014 05:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
cd into /tmp/kitchen.
sudo /opt/chef/embedded/bin/gem install chef-zero
sudo /opt/chef/embedded/bin/chef-zero -d
sudo knife cookbook upload -a -c client.rb
sudo chef-shell -z -c client.rb
@timcase
timcase / change_spec.rb
Created October 28, 2016 20:27 — forked from nelsonic/change_spec.rb
Coin Change Problem Single Method. Solved in Ruby. Nested until loops. ( requires RSpec) Available coins are USD: http://en.wikipedia.org/wiki/Coins_of_the_United_States_dollar ;-)
class Change
def change(amount)
available_coins = [100,50,25,10,5,1] # http://en.wikipedia.org/wiki/Coins_of_the_United_States_dollar
coins = []
index = 0
coin = available_coins[index]
remaining_amount = amount
until remaining_amount == 0
until remaining_amount >= coin
index = index + 1