Skip to content

Instantly share code, notes, and snippets.

View emcoding's full-sized avatar
🏠
Nurturing code

Maud de Vries emcoding

🏠
Nurturing code
View GitHub Profile
@jhjguxin
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created July 9, 2012 03:32
Creating nested resources in ruby on rails 3 and updating scaffolding links and redirection
@JoelQ
JoelQ / math.rb
Last active June 30, 2021 20:41
Derive addition, multiplication, and exponentiation from from `Integer#next`
def add(number1, number2)
number2.times.reduce(number1) { |total| total.next }
end
add(2,3)
# => 5
def subtract(number1, number2)
number2.times.reduce(number1) { |total| total.pred }
end