Skip to content

Instantly share code, notes, and snippets.

View eddroid's full-sized avatar

Ed Toro eddroid

View GitHub Profile
@eddroid
eddroid / survivor.rb
Created February 19, 2015 13:32
Wyncode C4: Survivor Simulator
class Survivor
attr_accessor :contestants, :teams
def initialize
@contestants = []
@teams = []
end
# return the losing team
def challenge
@eddroid
eddroid / i18n_me.rb
Last active August 29, 2015 14:16
i18n My Name
puts "Shawty what yo name is?"
n = gets.chomp.split(" ").join("")
l = n.length
puts "No it ain't. It's #{n[0]}#{l-2}#{n[l-1]}"
@eddroid
eddroid / write_refactor.md
Last active November 7, 2018 22:28
Refactoring Your Writing

In Order To

changing in order to meet new demands

changing to meet new demands

Adj. Phrases: That Is, Related To

a project that is difficult

@eddroid
eddroid / 1.never_boolean.md
Last active April 6, 2016 20:43
Ruby Refactorings

Never Boolean

You hardly ever have to use the word true in your code.

if (something == true)
  # do something cool
end

Can be rewritten as

@eddroid
eddroid / embarrassing.md
Last active August 29, 2015 14:19
The Most Embarrassing Technical Terms To Teach at a Coding School

As if diversity wasn't enough a problem.

Notable mentions

Git's default master branch

@eddroid
eddroid / batman.rb
Created April 16, 2015 22:00
Batman C5
class Batman
def intro
puts "*"*80
puts "Welcome to Batman: Arkham Asylum"
puts "*"*80
end
def ask_question(question, options)
puts "*"*80, question, "*"*80
@eddroid
eddroid / shark_tank.rb
Created April 23, 2015 21:36
Reality Show C5: Shark Tank
class SharkTank
attr_reader :sharks, :entrepreneur
def initialize
@sharks = []
end
def add_shark(shark)
@sharks << shark
end
@eddroid
eddroid / rinse_and_repeat.rb
Created April 23, 2015 21:38
C5 Pair Programming: Rinse & Repeat
uppers = "A".."Z"
lowers = "a".."z"
letters = uppers.to_a + lowers.to_a
numbers = ("0".."9")
####
## 1st question
####
all_letters = false
@eddroid
eddroid / same_thing.md
Last active January 19, 2016 21:33
The Same Thing Over and Over

Scope

Think of a telescope. As it extends right, it gets smaller.

__
|| __
|| || __
|| || || 
|| || __
|| __ 
@eddroid
eddroid / batman.rb
Created June 18, 2015 19:40
C6: Batman REPL Game
# display a line on the screen
#
# refactoring to
# - remove some Ruby jargon by defining a
# domain-specific-language (DSL)
# - remove some repetitive (copy-pasted) code
# - have a single place to change the line width
def put_a_line
puts "*" * 50
end