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
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
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
| phone_numbers = [ | |
| "(206) 555-1234", | |
| "425-555-9999", | |
| "406.555.1818", | |
| "+1 206 555 8888", | |
| "4255558872", | |
| ] | |
| pattern = /^.*(\d{3}).*(\d{3}).*(\d{4})$/ |
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
| class BabyDragon | |
| def initialize(name, color) | |
| @name = name | |
| @hungriness_level = 10 | |
| @is_asleep = false | |
| @thirst_level = 10 | |
| @color = color | |
| 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
| # Part 2 | |
| # 1 | |
| # You are given an array of String objects, stored in a variable called my_strings. | |
| # You want to use this array to create a new array of Integer objects, | |
| # which represents the length of each string. We want to store the resulting | |
| # array in a variable called string_lengths. | |
| # def animal_types(my_strings) | |
| # string_lengths = my_strings.map { |animal_index| |
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
| # Part 1 | |
| # 1 | |
| # You are given an array of String objects, stored in a variable called my_strings. | |
| # You want to use this array to create a new array of Integer objects, | |
| # which represents the length of each string. We want to store the resulting | |
| # array in a variable called string_lengths. | |
| # def animal_types(my_strings) | |
| # string_lengths = [] |
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
| # [2,5,8,11,14].each do |x| | |
| # puts 2 * x + 7 | |
| # end | |
| # ["kittens", "meerkats", "red pandas"].each do |critter| | |
| # affirmation = "I am as amazing as " + critter + "!" | |
| # print critter | |
| # puts affirmation | |
| # 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
| # establishing the run_generator method | |
| # getting all of the input needed | |
| # storing those pieces of input into variables | |
| # being able to print out those variables | |
| # iterating through individual characters in words to check which characters are vowels | |
| # https://github.com/Ada-C11/portmanteau-generator | |
| # wave 1: | |
| def is_vowel?(vowel) | |
| vowels = %w{a e i o u} |