This file contains hidden or 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
def whats_for_dinner | |
random_number = rand(4) | |
cars = ["ferrari", "civic", "aston martin", "corvette"] | |
car = cars[random_number] | |
car_hash = {"ferrari" => 1, "civic" => 2, "aston martin" => 3, "corvette" => 4} | |
random_value = car_hash[car] | |
dinner_picker = random_value - 1 | |
dinner_options = ["spaghetti", "lentil soup", "pizza", "smoothie"] | |
dinner_options[dinner_picker] | |
end |
This file contains hidden or 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
def batman_ironman_proc | |
victor = Proc.new { return "Batman will win!" } | |
victor.call | |
"Iron Man will win!" | |
end | |
puts batman_ironman_proc | |
def batman_ironman_lambda | |
victor = lambda { return "Batman will win!" } |
This file contains hidden or 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 - refresh (conditonals, logic, variable, gets, puts, file creation) | |
2 - arrays (<<, +) - where's waldo exercise (array picture) | |
3 - explain each | |
4 - loop exercise - working with each | |
5 - working with each | |
6 - array exercise (houston and dirty zipcode) adv-go to reverse | |
7 - putting it all together - grandma | |
8 - intro to hash (why use, picture) | |
9 - hash ex 1 | |
10 - hash ex 2 |
This file contains hidden or 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
def accepted_params(*add_params=nil) | |
permitted = [:name, :age, :email] | |
if add_params | |
permitted = permitted.concat(*add_params.map(&:to_s)) | |
end | |
params.require(:user).permits(permitted) | |
end |
This file contains hidden or 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
Workout A | |
Squat | |
Bench Press | |
Barbell Row | |
Workout B | |
Squat | |
Overhead Press | |
Deadlift |
This file contains hidden or 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
variables | |
---base algorithm--- | |
total dollars spent minus refunds | |
frequency of purchase since joining | |
Dollars spent per month / rolling month to month | |
email engagement | |
---nice to have--- | |
amount purchased over voucher amount |
This file contains hidden or 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
require 'formula' | |
class Mysql < Formula | |
homepage 'http://dev.mysql.com/doc/refman/5.5/en/' | |
url 'http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.29.tar.gz' | |
version '5.5.29' | |
sha1 '40e26b193b6ece86ce97896c0c9c524d479e37be' | |
bottle do | |
sha1 '3c5b57df466eb538db58654c5f046ddf7bc675e9' => :mountainlion |
This file contains hidden or 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
#string | |
"any text" | |
"put_anything_you_really_want" | |
'no big deal' | |
#integer | |
5 | |
puts 4 * 3 | |
3 / 3 |
This file contains hidden or 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
[user] | |
name = michael verdi | |
email = [email protected] | |
[core] | |
autocrlf = input | |
safecrlf = true | |
editor = subl -w | |
excludesfile = /Users/michaelverdi/.gitignore_global | |
[alias] | |
co = checkout |
This file contains hidden or 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 Numeralize | |
def self.to_roman(number) | |
divisors = { 1000.0 => "M", | |
500.0 => "D", | |
100.0 => "C", | |
50.0 => "L", | |
10.0 => "X", | |
5.0 => "V", | |
1.0 => "I" } |