Skip to content

Instantly share code, notes, and snippets.

@phlipper
phlipper / warmup.rb
Created April 1, 2015 00:37
TECH603 Day 3 Warmup
# 1. Create a `day_3` directory under the course directory.
# 2. Save this file under the new folder as `warmup.rb`.
# 3. Assign any string value to a variable.
# 4. Assign any whole number to a variable.
# 5. Assign any decimal number to a variable.
@phlipper
phlipper / warmup.rb
Created March 26, 2015 22:49
TECH603 Day 2 Warmup
# 1. Create a `day_2` directory under the course directory.
# 2. Save this file under the new folder as `warmup.rb`.
# 3. Assign your favorite vacation location to a variable called `destination`.
# 4. Assign the number of days you'd like to visit to a variable called
# `duration`.
# 5. Assign any floating point number to a variable named `price`.
@phlipper
phlipper / true_false.rb
Created March 25, 2015 06:31
TECH603 Day 1 Example - "Truthy" and "Falsey"
# output the values
puts true
puts false
# test true
if true then
puts "true is true"
else
puts "true is not true"
end
@phlipper
phlipper / warmup.rb
Created March 19, 2015 22:39
TECH601-00 Day 6 Warmup
# our list of countries
countries = []
countries.push({
"id" => "AGO",
"name" => "Angola",
"population" => 21_471_618,
"capital" => "Luanda",
"latitude" => -8.81155,
"longitude" => 13.242,
@phlipper
phlipper / countries.rb
Created March 18, 2015 14:06
TECH601-00 Day 5 Example - Lists of Countries
# an empty list of countries
countries = []
# `push` a country on to the list
countries.push({
"id" => "AGO",
"name" => "Angola",
"population" => 21_471_618,
"capital" => "Luanda",
"latitude" => -8.81155,
@phlipper
phlipper / letters.rb
Created March 18, 2015 14:03
TECH601-00 Day 5 Example - Lists of Letters and Vowels
letters = "a".."g"
vowels = ["a", "e", "i", "o", "u"]
# Loop through each letter and print whether it is a vowel or consonant
# letters.each_with_index do |letter, index|
# if letter == "a" || letter == "e" || letter == "i" || letter == "o" || letter == "u"
# puts "vowel at index #{index}"
# else
# puts "consonant at index #{index}"
@phlipper
phlipper / warmup.rb
Created March 18, 2015 14:02
TECH601-00 Day 5 Warmup
# Convert all of the following country data in to a Hash, like that of Angola
# Angola
angola = {
"id" => "AGO",
"name" => "Angola",
"population" => 21_471_618,
"capital" => "Luanda",
"latitude" => -8.81155,
"longitude" => 13.242,
@phlipper
phlipper / warmup.rb
Created March 17, 2015 22:33
TECH601-00 Day 5 Warmup
# Convert all of the following country data in to a Hash, like that of Angola
# Angola
angola = {
"id" => "AGO",
"name" => "Angola",
"population" => 21_471_618,
"capital" => "Luanda",
"latitude" => -8.81155,
"longitude" => 13.242,
@phlipper
phlipper / day_5_prep.md
Created March 17, 2015 22:11
TECH601-00 Day 5 preparation

Console

These console commands will prepare you for the day:

# change directory to the course root - hint: type `cd T` and hit the `tab` key
cd TECH601-00/

# make a new directory for today
mkdir day_5
@phlipper
phlipper / countries.rb
Created March 17, 2015 21:29
TECH601-00 Day 4 - Hash exercises with country data
# DRY this up!
# DRY - Don't Repeat Yourself! :)
# Data Type vs. Data Structure
#
# New Data Type: Hash (or dictionary)
# A Hash is a Data Structure
# Angola: