This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name: Rosie Hoyem | |
Github: http://github.com/rosalita | |
Blog: http://rosiehoyem.com/ | |
Tagline: Urbanist, Energy Wonk, Programmer | |
Profile Picture: http://nyobetabeat.files.wordpress.com/2012/09/avi_026-1.jpg | |
Treehouse Account: http://teamtreehouse.com/rosiehoyem | |
CoderWall Account: https://coderwall.com/rosalita | |
CodeSchool Account: http://www.codeschool.com/users/rosalita | |
Favorite Websites: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Begin by picking up the peanut butter containing and grasp the metal lid. Turn it is a counter clockwise direction until it is dislodged from the container. Place the open jar and cover on the table. | |
2. Repeat step 1 with the jam jar. | |
3. Gently grasp the open end of the bread bag an remove the plastic closing mechanism. | |
4. Reach inside the bag and remove two precut sections, or slices, of the bread substance. | |
5. Place the two slices of bread slide by side, broad faces down on the plate. | |
6. Take the knife (the skinny metal object approximately 8 inches long) and insert it into the open peanut butter jar 2 inches, then tilt it to an angle of 30 degrees. | |
7. Remove the knife and some of the peanut butter material. | |
8. Light press the flat side of the knift to the large face of one of the pieces of bread gently move the knift paralel to the bread, smearing the peanut butter material over the full face to a depth of between 1/8 to 1/4 inch in thickness. | |
Repeat step X with the jam jar and the other piece of bread |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fizzbuzz(*num) | |
num.each do |x| | |
if x % 3 == 0 && x % 5 == 0 | |
return "FizzBuzz" | |
elsif x % 3 == 0 | |
return "Fizz" | |
elsif x % 5 == 0 | |
return "Buzz" | |
else | |
return x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write a program that tells you the following: | |
# | |
# Hours in a year. How many hours are in a year? | |
# Minutes in a decade. How many minutes are in a decade? | |
# Your age in seconds. How many seconds old are you? | |
# | |
# Define at least the following methods to accomplish these tasks: | |
# | |
# seconds_in_minutes(1) | |
# minutes_in_hours(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
Write a method that will take a tweet, search it for | |
words that you can substitute, and return a substituted string | |
tweet. For instance, the tweet "Hello to you, I'm at home" | |
would become "Hi 2 u, I'm @ home". The client has provided | |
the following acceptable substitutes. => e | |
Objectives | |
1. Write a method to shorten a string based on the allowed substitutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
1. print phrases with names | |
2. create array with phrases | |
3. assign rooms to speakers | |
4. create another array with speaker welcome | |
=end | |
# "Hello, my name is _____." | |
name = ["Edsger", "Ada", "Charles", "Alan", "Grace", "Linus", "Matz"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
Let's go back to the exercise where we determined what | |
is and isn't a vowel. With ruby, there's always more than | |
one way to do something and get the same result. | |
Assuming vowels a,e,i,o,u: | |
#1 Write a method that returns whether a given letter is a vowel, | |
using if and elsif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A movie collection that organizes by genres | |
# Recipes with ingredients | |
# User profiles where each user has a list of favorite colors along | |
# with 3 personal essays, essay_1, essay_2, essay_3 | |
movie_collection = { | |
:comedy => ["Dumb and Dumber", "Billy Madison", "American Pie"], | |
:action_adventure => ["Indiana Jones", "Die Hard", "Terminator"], | |
:documentary => ["Man on a Wire", "Exit Through the Gift Shop"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################## | |
# NYC PIGEON ORGANIZER # | |
######################## | |
pigeon_data = { | |
:color => { | |
:purple => ["Theo", "Peter Jr.", "Lucky"], | |
:grey => ["Theo", "Peter Jr.", "Ms .K"], | |
:white => ["Queenie", "Andrew", "Ms .K", "Alex"], | |
:brown => ["Queenie", "Alex"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Anagram | |
attr_accessor :word | |
def initialize(word) | |
@word = word | |
end | |
def match(array) | |
@word = @word.chars.sort | |
array.select { |element| element.chars.sort == @word } |
OlderNewer