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: Michael Polycarpou | |
Github: http://github.com/polycarpou | |
Blog: http://michaelpolycarpou.com/ | |
Tagline: Engineering The Future | |
Profile Picture: https://scontent-a-lga.xx.fbcdn.net/hphotos-ash3/1013112_10153019457290517_719698305_n.jpg | |
Treehouse Account: http://teamtreehouse.com/michaelpolycarpou | |
CoderWall Account: https://coderwall.com/polycarpou | |
CodeSchool Account: http://www.codeschool.com/users/polycarpou | |
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
Welcome to Earth! | |
The following is a tutorial on how to make peanut butter and jelly sandwiches exactly how real humans make them in 10 easy steps! | |
1. Open the bread wrapper. The bread is the large, yellow, soft object on the table that also has bread written on it. The actual bread is wrapped around a thin and clear wrapper that contains the bread within. The easiest way to get to the bread is to create a hole in the wrapper by applying a large force (approximately 40 newtons to an area the size of a finger (50cm squared). Do this without harming the bread inside. | |
2. Place a slice of bread on the plate. To do this we need to widen the hole in the wrapper and gently take out one of the sections of the bread without ripping it apart. Place this slice on the plate which is the circular hard flat object on the table. | |
3. Open Peanut butter jar. To open the peanut butter jar (the brown hard cylinder container that says peanut butter) we grip the bottom of the jar with one hand so that it is stationary and w |
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
CREATE TABLE artists( | |
name TEXT, | |
age INTEGER, | |
genre TEXT, | |
sales, INTEGER, | |
weight, REAL | |
); | |
ALTER TABLE artists ADD COLUMN language TEXT; | |
ALTER TABLE artists ADD COLUMN description TEXT; |
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(x) | |
if x%3 ==0 && x%5 ==0 | |
puts "fizzbuzz" | |
elsif x%3 ==0 | |
puts "fizz" | |
elsif x%5 ==0 | |
puts "buzz" | |
end | |
end | |
fizzbuzz(5) |
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 my_each(arr) | |
count = 0 | |
while count <= arr.length | |
yield(arr[count]) | |
count += 1 | |
end | |
end | |
my_each([1,2,3,4,6]) do |x| | |
puts 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
def is_a_vowel1(letter) | |
if letter == "a" | |
return true | |
elsif letter == "e" | |
return true | |
elsif letter == "i" | |
return true | |
elsif letter == "o" | |
return true | |
elsif letter == "u" |
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 print_badge(name) | |
"Hello, my name is #{name}." | |
end | |
#puts print_badge("Michael") | |
speakers = "Edsger, Ada, Charles, Alan, Grace, Linus, Matz" | |
speakers = speakers.split(", ") | |
#p speakers |
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
# 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 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 shorten_tweet(tweet) | |
return tweet if tweet.length < 140 | |
tweet = tweet.split(" ") | |
out = [] | |
tweet.each do |word| | |
case word | |
when "to", "two", "too" | |
out << '2' | |
when "for", "four" | |
out << '4' |
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
# Hashketball Nests | |
# | |
# Great news! You're going to an NBA game! The only catch is that you've been | |
# volunteered to keep stats at the game. | |
# | |
# Using Nested Hashes, define a game, with two teams, their players, and the players stats: | |
# | |
# The game has two teams. | |
# | |
# A team has: |
OlderNewer