Skip to content

Instantly share code, notes, and snippets.

Your Name: Saron Yitbarek
Github Username: sarony
Blog Url (if you don't already have a blog it will be githubusername.github.io): www.bloggytoons.com
Tagline: "You'll never be stupider than you are right now."
Profile Picture (something normal, a headshot, of a good reusable size that can be easily cropped):
Treehouse Account: http://teamtreehouse.com/saronyitbarek
CoderWall Account: https://coderwall.com/saronyitbarek
CodeSchool Account: N/A
Favorite Websites: http://twitter.com, http://theoatmeal.com
Previous Work Experience: Program Manager @ IncubateNYC, Account Strategist @ Contently, BD @ Cliqk, Reporter @ NPR
1. Commit the following information to memory:
- The round, flat object is called "plate". From now on, it will be referred to as "plate".
- The thing full of the purple, sticky substance is filled with "jelly." From now on, the contents of the thing will be referred to as "jelly." The thing itself will be referred to as the "jar of jelly."
- The thing full of the sticky, brown substance is filled with "peanut butter." From now on, the contents of the thing will be referred to as "peanut butter." The thing itself will be referred to as the "jar of peanut butter."
- The soft, oblong object is called "bread." From now on, it will be referred to as "bread."
- A piece of the "bread" that is removed from the "bread" is called a "slice of bread." From now on, it will be referred to as "slice of bread."
- The long, silver object with a sharp edge is called a "knife." From now on, it will be referred to as "knife."
2. Pick up the "plate."
3. Put the "plate" directly in front of you.
SQLite format 3@ -‚$
®®
CREATE TABLE artists(
name TEXT,
num_albums INTEGER,
genre TEXT,
num_concerts INTEGER
);
ALTER TABLE artists ADD COLUMN fav_color TEXT;
ALTER TABLE artists ADD COLUMN age INTEGER;
@sarony
sarony / FizzBuzz.rb
Last active December 23, 2015 23:29
fizz = []
buzz = []
fizzbuzz= []
for counter in 1..50
if counter%3==0 || counter%5==0
if (counter%3==0)&&(counter%5!=0)
puts "Fizz #{counter}"
fizz.push(counter)
elsif (counter%5==0) && (counter%3!=0)
# Write a program that tells you the following:
# A lot of the extra puts are for me to check my work, make sure I had matching answers, and easier viewing of my answers.
def seconds_in_minutes(mins)
mins*60
end
def minutes_in_hours(hours)
hours*60
end
# You're hosting a conference and need to print badges for the speakers. Each badge should say: "Hello, my name is _____."
# 1. Write a method that will create and return this message, given a person's name.
def print_name(name)
puts "Hello my name is #{name}."
end
# 2. 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.
# 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:
# # Write a method that returns whether a given letter is a vowel, using if and elsif
def is_a_vowel(n)
if n =="a"
elsif n=="e"
return true
elsif n=="i"
# You're hosting a conference and need to print badges for the speakers. Each badge should say: "Hello, my name is _____."
# 1. Write a method that will create and return this message, given a person's name.
def print_name(name)
puts "Hello my name is #{name}."
end
# 2. 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.
# NOTES: Not finished, but started programming the different components that I thought would make up the final script.
# Tweet Shortener
# A client has hired you to automatically post some of their brand messages to twitter, but the problem is that some of them are too long. Your job is to shorten them by replacing longer words with shorter representations (i.e. "two" becomes "2").
# 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.
case x
when "to", "two", "too"