Skip to content

Instantly share code, notes, and snippets.

View J-Scag's full-sized avatar

Josh Scaglione J-Scag

  • New York
View GitHub Profile
@J-Scag
J-Scag / josh-scaglione-pbj
Last active December 23, 2015 18:59
alien-sandwich homework for the Flatiron School day 1
1. Take 2 sections (slices) of the long brown object (bread)
2. Lay the slices side by side on the plate (flat round object)
3. Grasp the clear glass vessel (jelly jar) containing purple ooze (jelly) firmly in one hand, grasp the lid of the jelly jar firmly with the other
4. Twist lid in a counter-clockwise direction until loose
5. Place jelly jar (open side up) and jelly jar lid on top of the table
6. Pick up elongated piece of metal (knife) by the thicker end (handle)
7. With a scooping motion, remove some jelly from the jelly jar with the knife
8. Move knife with jelly over one of the two slices of bread
9. Turn it so the jelly is facing the bread and spread with left to right sweeping motions
10. Place knife on the plate, next to the bread
@J-Scag
J-Scag / artitst.db
Created September 24, 2013 23:33
I couldn't figure out how to upload the file so here's the contents pasted in.
CREATE TABLE musicians(name TEXT, age INTEGER, genre TEXT, instrument TEXT);
ALTER TABLE musicians ADD COLUMN favorite_color TEXT;
ALTER TABLE musicians ADD COLUMN location TEXT;
DROP TABLE musicians;
CREATE TABLE musicians(name TEXT, age INTEGER, genre TEXT, instrument TEXT, location TEXT);
ALTER TABLE musicians RENAME TO artists;
DROP TABLE artists;
@J-Scag
J-Scag / js-fizzbuzz.rb
Created September 26, 2013 04:43
Fizzbuzz in ruby for flatiron school homework.
def fizz_buzz(num)
if num % 3 == 0 && num % 5 == 0
"fizzbuzz"
elsif num % 3 == 0
"fizz"
elsif num % 5 == 0
"buzz"
else
num
end
def seconds_in_minutes(mins)
mins * 60
end
def minutes_in_hours(hrs)
hrs * 60
end
def hours_in_days(days)
days * 24
playlist_1 = [223,215,378,324,254]
def to_min(length)
mins = length / 60
secs = length % 60
formatted = mins.to_s + ":" + secs.to_s
end
def total_length(playlist)
@J-Scag
J-Scag / second_program.rb
Created September 27, 2013 02:06
Second ruby program for Flatiron School
# 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",
@J-Scag
J-Scag / conference.rb
Created September 27, 2013 02:12
Conference homework for Flatiron School day 4.
# 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
@J-Scag
J-Scag / vowels.hw.rb
Created September 27, 2013 02:13
Vowels homework for Flatiron School day 4.
def is_a_vowel?(letter)
vowels = ['a','e','i','o','u']
vowels.each{|vow| return true if vow == letter}
return false
end
def vowels_with_if(letter)
if letter == 'a'
true
# 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
# ======================================
@J-Scag
J-Scag / js-jukebox.rb
Created September 27, 2013 21:32
Jukebox lab, plus the ability to take slightly wrong input and still function!
# Download Gist: https://gist.github.com/scottcreynolds/e6534b284373efe0ba6e/download
# Build a Jukebox
# create a file jukebox.rb
# When that program is run, it should introduce itself
# to the user and accept input from the user using the gets command.
# The jukebox should respond to 4 commands, help, play, list and exit.