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
Name: Brendan Manley | |
Github: https://github.com/manleyhimself | |
Blog: N/A | |
Tagline: Where there's a will, there are countless ways. | |
Profile Picture: https://docs.google.com/drawings/d/1zac66Ku3kT7ZdmMFZrV32IbyuRpXi3LRZnA-YUgeth8/edit | |
Treehouse Account: http://teamtreehouse.com/brendanmanley | |
CoderWall Account: https://coderwall.com/manleyhimself | |
CodeSchool Account: http://www.codeschool.com/users/manleyhimself | |
Favorite Websites: |
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. An object is a material thing that can be seen and touched. Among the objects in front of you, there should be a flat and circular object. This is a plate. | |
2. There is also a loaf of bread. This is the the only soft object before you. Moreover, it appears as an oblong shape and is cut into portions. Each single portion of the loaf is known as a slice. | |
3. The bread is within a clear, light material; known as plastic. On one side of this loaf of bread, there will be a notable excess of plastic. This plastic has been twisted and tied, to hold the bread safely within it. | |
4. Untie and then untwist the plastic. After untwisting the plastic, you should notice that the loaf of bread is now acessible. It can be touched. | |
5. Reach inside, remove two slices, and place them on to the plate. They should not be stacked. | |
6. The next step is to locate the peanut butter jar and the jelly jar. Look for two wide-mouthed, cylindrical objects. | |
7. Since using color as an identifier may not work because of our physiological dif |
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 fizzbuzz(limit) | |
fizz_array = [] | |
buzz_array = [] | |
fb_array = [] | |
num = 1 | |
while num <= limit | |
if (num % 3 == 0) && (num % 5 == 0) | |
puts "fizzbuzz" | |
fb_array << num | |
elsif num % 3 == 0 |
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 short(tweets) | |
sub_hash = { "too" => "2", "to" => "2", "two" => "2", "For" => "4", " for " => " 4 ", "four" => "4", " be " => " b ", "you" => "u", " at " => " @ ", "and" => "&"} | |
if tweets.length > 140 | |
sub_hash.each do |k,v| | |
tweets.gsub!(k,v) if tweets.include?(k) | |
end | |
if tweets.length > 140 | |
tweets[0,140] | |
else | |
tweets |
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 my_each(array) | |
i = 0 | |
while i < array.length | |
yield(array[i]) | |
i += 1 | |
end | |
end | |
num_array = [5,6,7,8] |
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 normalize_phone_number(number) | |
clean_num = number.gsub(/[^0-9]/, "") | |
clean_num.length != 10 ? number : "(#{clean_num[0,3]}) #{clean_num[3,3]}-#{clean_num[6,4]}" | |
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 reverse_each_word(sentence) | |
sen_array = sentence.split(" ") | |
sen_rev = sen_array.map { |word| word.reverse} | |
sen_rev = sen_rev.join(" ") | |
end | |
puts reverse_each_word("Hello there, and how are you?") |
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
apple_picker(["apple", "orange", "apple"]) #=> ["apple", "apple"] | |
apple_picker.map { |x| puts x} | |
apple_picker.select { |x| puts x } |
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
holiday_supplies = { | |
:winter => { | |
:christmas => ["Lights", "Wreath"], | |
:new_years => ["Party Hats"] | |
}, | |
:summer => { | |
:forth_of_july => ["Fireworks", "BBQ"] | |
}, | |
:fall => { | |
:thanksgiving => ["Turkey"] |
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
katz_deli = [] | |
def take_a_number(deli_line, customer) | |
deli_line << customer | |
deli_line.index(customer) + 1 | |
end | |
def now_serving(deli_line) | |
"Currently serving #{deli_line[0]}" |
OlderNewer