This file contains hidden or 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. Take 2 sections (slices) of the long brown object (bread) | |
| 2. Lay the slices side by side on the plate (flat round object) | |
| 3. Grasp the clear glass vessel (jelly jar) containing purple ooze (jelly) firmly in one hand, grasp the lid of the jelly jar firmly with the other | |
| 4. Twist lid in a counter-clockwise direction until loose | |
| 5. Place jelly jar (open side up) and jelly jar lid on top of the table | |
| 6. Pick up elongated piece of metal (knife) by the thicker end (handle) | |
| 7. With a scooping motion, remove some jelly from the jelly jar with the knife | |
| 8. Move knife with jelly over one of the two slices of bread | |
| 9. Turn it so the jelly is facing the bread and spread with left to right sweeping motions | |
| 10. Place knife on the plate, next to the bread |
This file contains hidden or 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
| CREATE TABLE musicians(name TEXT, age INTEGER, genre TEXT, instrument TEXT); | |
| ALTER TABLE musicians ADD COLUMN favorite_color TEXT; | |
| ALTER TABLE musicians ADD COLUMN location TEXT; | |
| DROP TABLE musicians; | |
| CREATE TABLE musicians(name TEXT, age INTEGER, genre TEXT, instrument TEXT, location TEXT); | |
| ALTER TABLE musicians RENAME TO artists; | |
| DROP TABLE artists; |
This file contains hidden or 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 fizz_buzz(num) | |
| if num % 3 == 0 && num % 5 == 0 | |
| "fizzbuzz" | |
| elsif num % 3 == 0 | |
| "fizz" | |
| elsif num % 5 == 0 | |
| "buzz" | |
| else | |
| num | |
| end |
This file contains hidden or 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 seconds_in_minutes(mins) | |
| mins * 60 | |
| end | |
| def minutes_in_hours(hrs) | |
| hrs * 60 | |
| end | |
| def hours_in_days(days) | |
| days * 24 |
This file contains hidden or 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
| playlist_1 = [223,215,378,324,254] | |
| def to_min(length) | |
| mins = length / 60 | |
| secs = length % 60 | |
| formatted = mins.to_s + ":" + secs.to_s | |
| end | |
| def total_length(playlist) |
This file contains hidden or 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
| # Given this List of Songs, Construct Arrays by Artist and Album | |
| # Hint: Make use of the split() String Method | |
| # http://www.ruby-doc.org/core-1.9.3/String.html#method-i-split | |
| # Simple Example of Data Parsing | |
| songs = [ | |
| "The Magnetic Fields - 69 Love Songs - Parades Go By", | |
| "The Magnetic Fields - Get Lost - Smoke and Mirrors", | |
| "Neutral Milk Hotel - In An Aeroplane Over the Sea - Holland 1945", | |
| "The Magnetic Fields - Get Lost - You, Me, and the Moon", |
This file contains hidden or 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
| # You're hosting a conference and need to print badges for the speakers. | |
| # Each badge should say: "Hello, my name is _____." | |
| # Write a method that will create and return this message, given a person's name. | |
| # Now the list of speakers is finalized, and you can send the list of badges | |
| # to the printer. Remember that you'll need to give this list to the printer, | |
| # so it should be accessible outside of the method. | |
| # Modify your method so it can take a list of names as an argument and return |
This file contains hidden or 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 is_a_vowel?(letter) | |
| vowels = ['a','e','i','o','u'] | |
| vowels.each{|vow| return true if vow == letter} | |
| return false | |
| end | |
| def vowels_with_if(letter) | |
| if letter == 'a' | |
| true |
This file contains hidden or 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
| # Download this file: | |
| # https://gist.github.com/scottcreynolds/ac1b5c8d96de0c91bf7c/download | |
| # Run it from your terminal with: | |
| # ruby ruby_phone_format.rb | |
| # (Just make sure you are in the right directory) | |
| # ====================================== | |
| # Ignore All This Code | |
| # ====================================== |
This file contains hidden or 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
| # Download Gist: https://gist.github.com/scottcreynolds/e6534b284373efe0ba6e/download | |
| # Build a Jukebox | |
| # create a file jukebox.rb | |
| # When that program is run, it should introduce itself | |
| # to the user and accept input from the user using the gets command. | |
| # The jukebox should respond to 4 commands, help, play, list and exit. |
OlderNewer