Skip to content

Instantly share code, notes, and snippets.

1. There are 5 objects on the table, 3 are relatively tall and 2 are relatively short
2. Of the 2 short objects, 1 is shiny and narrow. That is a knife.
3. The other short object is a plate.
4. Of the 3 taller objects, 2 are hard and 1 is soft. The soft taller object we will call bread. The other two taller objects will be called jars.
5. Grab 1/10 of the bread and put it on the plate
6. Repeat step 5
7. Grab a jar and twist the top in circles until it comes off. If it is not turning then switch directions.
8. Take the knife and dip it into the open jar until it is covered with the contents of the jar
9. Take the knife and wipe it on to the bread until the knife is clean.
10. Repeat steps 7-9 with the other jar
Your Name: Adam Waxman
Github Username: awaxman11
Blog Url: https://medium.com/@ajwaxman
Tagline: Build. Break. Learn.
Profile Picture
Treehouse Account: http://teamtreehouse.com/adamjwaxman
CoderWall Account: https://coderwall.com/awaxman
CodeSchool Account: http://www.codeschool.com/users/awaxman11
Favorite Websites:
@ajwaxman
ajwaxman / gist:5745554
Created June 9, 2013 22:35
ruby-logic-assignment
# assignment.rb
# write an expression that returns true by using ==
1 == 1
# write an expression that returns false using ==
1 == 2
# write an expression that returns true using !=
1 != 2
@ajwaxman
ajwaxman / gist:5746156
Created June 10, 2013 02:26
fizz-buzz
(1..50).each do |num|
if num % 3 == 0 && num % 5 == 0
puts "FizzBuzz"
elsif num % 5 == 0
puts "Buzz"
elsif num % 3 == 0
puts "Fizz"
else
puts num
end
@ajwaxman
ajwaxman / gist:5754286
Created June 11, 2013 03:21
simple-arrays
# Construct an array with your favorite foods.
# It should have at least 5 element
fav_food = ["ice cream", "pizza", "chipotle", "bagels", "cereal"]
#Write a puts which returns your most favorite food out of the array
puts = fav_food[0]
# Construct an array with the colors of the rainbow (ROYGBIV)
colors_of_rainbow = [
"red",
@ajwaxman
ajwaxman / gist:5754289
Created June 11, 2013 03:22
make-some-hashes
# Create hashes for the following use-cases:
# A movie collection that organizes by genres
movie_collection = {
:comedy => ["Happy Gilmore", "The Hangover"],
:kids => ["Up", "Finding Nemo"]
}
# Recipes with ingredients
@ajwaxman
ajwaxman / gist:5754293
Created June 11, 2013 03:23
method-chaining
puts "si eman ym ,iH".reverse.concat(" Adam").upcase.downcase.capitalize
puts "si eman ym ,iH".reverse
#=> Hi, my name is
puts "si eman ym ,iH".reverse.concat(" Adam")
#=> Hi, my name is Adam
puts "si eman ym ,iH".reverse.concat(" Adam").upcase
#=> HI, MY NAME IS ADAM
#Temperature bot is comfortable when it's room temperature (18-21C).
# Help him out by completing the method below:
# Temperature bot is American but takes Celsius temperatures.
def temperature_bot(temp)
case temp
when 18..21
"I like this temperature"
else
@ajwaxman
ajwaxman / gist:5754447
Created June 11, 2013 04:16
hasketball
game = {
# Cleveland Cavs
:team_1 => {
:name => "Cleveland Cavs",
:colors => ["Maroon", "Gold"],
:players => {
# Cleveland Cavs Players
require "sqlite3"
require 'open-uri'
require 'nokogiri'
###############
# # Open a database
db = SQLite3::Database.new "test.db"
rows = db.execute <<-SQL