Skip to content

Instantly share code, notes, and snippets.

@gregeng
gregeng / gregeng_profile.txt
Last active December 23, 2015 18:39
Flatiron School Student Profile Content
Name: Greg Eng
Github: http://github.com/gregeng
Blog: gregeng.github.io
Tagline: Does it for the story / Do it for the story
Profile Picture: https://dl.dropboxusercontent.com/u/15030603/ProfilePic.jpg
Treehouse Account: http://teamtreehouse.com/gregeng
CoderWall Account: https://coderwall.com/gregeng
CodeSchool Account: http://www.codeschool.com/users/gregeng
Favorite Websites:
@gregeng
gregeng / alien-sandwich.md
Last active December 23, 2015 18:59
Instructions for making a peanut butter and jelly sandwich.

Alien, please make me a PB & J sandwich

  1. Pick up loaf of bread in the bag.
  2. Remove wire tie around the plastic bread bag.
  3. Open the bag.
  4. Select 2 slices of from the bread loaf that are not the first or the last slices in the bag. Each slice should have the same color on both sides.
  5. Place the two slices of bread on the plate side by side: left and right.
  6. Twist plastic bread bag.
  7. Tie wire around the twisted portion of the plastic bread bag.
@gregeng
gregeng / gist:6695140
Created September 25, 2013 04:22
SQL statements for magical.db and artists.db
--magical.db
--01_create_wizards.sql
CREATE TABLE wizards(
name TEXT,
age INTEGER
);
--02_add_color_to_wizards.sql
@gregeng
gregeng / gist:6709385
Created September 26, 2013 03:09
fizzbuzz
# assignment.rb
# FizzBuzz - The Programmer's Stairway to Heaven
# Define the fizzbuzz method to do the following: 10pts
# Use the modulo % method (divisible by)
# 2 % 2 #=> true
# 1 % 2 #=> false
# If a number is divisible by 3, puts "Fizz".
# If a number is divisible by 5, puts "Buzz".
# If a number is divisible by 3 and 5, puts "FizzBuzz"
@gregeng
gregeng / gist:6709402
Last active December 23, 2015 23:19
quiz
# Write a program that tells you the following:
#
# Hours in a year. How many hours are in a year?
# Minutes in a decade. How many minutes are in a decade?
# Your age in seconds. How many seconds old are you?
#
# Define at least the following methods to accomplish these tasks:
#
# seconds_in_minutes(1)
# minutes_in_hours(1)
@gregeng
gregeng / gist:6723087
Last active December 24, 2015 01:19
Lab: Conference Badges and Schedules // Lab: Different Ways to Discover what's true
# 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 a list of badge messages.
# Your conference speakers are: Edsger, Ada, Charles, Alan, Grace, Linus and Matz. How you scored these luminaries is beyond me, but way to go!
@gregeng
gregeng / gist:6723133
Created September 27, 2013 01:45
Day 4: The Second Program
# 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",
@gregeng
gregeng / gist:6723514
Created September 27, 2013 02:42
Day 4: Another Homework - Tweet Shortener
# Tweet Keyword Shortener
# "to, two, too" become '2'
# "for, four" become '4'
# 'be' becomes 'b'
# 'you' becomes 'u'
# "at" becomes "@"
# "and" becomes "&"
# Possible Regexes
@gregeng
gregeng / lab1-hashesandreverse.rb
Created October 1, 2013 12:02
Lab 1: Hashes Reverse Each Word
# A movie collection that organizes by genres
# Recipes with ingredients
# User profiles where each user has a list of favorite colors along with 3 personal essays, essay_1, essay_2, essay_3
## Hashes
movie_collection = {
:action => ["Man on Fire", "Fight Club"]
:adventure => ["National Treasure", "National Treasure 2"]
:comedy => ["BASEketball", "Wedding Crashers"]
@gregeng
gregeng / lab2-applepickerholidays.rb
Created October 1, 2013 12:03
Lab 2: Apple Picker Holidays
# Apple Picker
# Skills: Collect and Select
def apple_picker_collect(fruits=["apple", "orange", "apple"])
only_apples = fruits.collect do |x|
x if x == "apple"
end
only_apples.compact!