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
1. There are 5 objects in front of you | |
2. Each of these objects has a name | |
3. They are arranged from left to right | |
4. Left and right are opposites | |
5. The object closest to you is the furthest to the right | |
6. The object four objects away from it is the furthest to the left | |
7. The object furthest to the right is called a plate | |
8. The object to the left of the plate is called a knife | |
9. The object to the left of the knife is called Peanut Butter | |
10. The object to the left of the peanut butter is called jelly |
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
/* Part 1 */ | |
CREATE TABLE musicians( | |
name TEXT, | |
age INTEGER, | |
rating REAL, | |
genre TEXT, | |
instrument TEXT | |
); | |
/* Part 2 */ |
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/aviflombaum/28534c5d69edd2439a7d/download | |
# Run it from your terminal with: | |
# ruby ruby.basics.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
# 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" |
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
##### PLAYLIST ##### | |
# Given: | |
# 5 songs of the following lengths in seconds | |
# 223,215,378,324,254 | |
# Goals: | |
# Assign the length set to variables | |
# Calculate the Total Length of the Playlists | |
# Express the Length in Minutes |
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
function empty () { | |
pushd ~/.Trash > /dev/null | |
tmp=$(rm -rfv * | wc -l | sed -e 's/^[ \t]*//') | |
if [ $tmp == "1" ]; then | |
echo "$tmp file was removed." | |
else | |
echo "$tmp files were removed." | |
fi | |
pushd > /dev/null | |
} |
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
# Configuring Our Prompt | |
# ====================== | |
# This function is called in your prompt to output your active git branch. | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
# This function builds your prompt. It is called below | |
function prompt { |
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
# USE: trash <filename or dirname> | |
function trash () { | |
mv $1 ~/.Trash/$1 > /dev/null | |
} | |
# USE: empty | |
function empty () { | |
pushd ~/.Trash > /dev/null | |
tmp=$(rm -rfv * | wc -l | sed -e 's/^[ \t]*//') |
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
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", | |
"The Magnetic Fields - 69 Love Songs - The Book of Love", | |
"Neutral Milk Hotel - In An Aeroplane Over the Sea - The King of Carrot Flowers" | |
] | |
airplane = [] |
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
class LoganArray < Array | |
def my_each | |
i = 0 | |
while i < self.length do | |
yield(self[i]) | |
i += 1 | |
end | |
self | |
end |
OlderNewer