Skip to content

Instantly share code, notes, and snippets.

View justuseapen's full-sized avatar

Justus Eapen justuseapen

View GitHub Profile
@justuseapen
justuseapen / disTRACKted
Created November 3, 2013 19:30
Simple distraction tracking program
def first_question
puts "Would you like to start a new session?"
answer = gets.chomp.downcase
if answer == "yes"
new_session
else
puts "Ok. Would you like to review a previous session?"
prev_session = gets.chomp.downcase
if prev_session == "yes"
LIGHT = 5.00
MEDIUM = 7.50
BOLD = 9.75
def coffee_selection
puts "How many packs of LIGHT would the customer like?"
light_total = LIGHT*gets.chomp.to_f
puts "How many packs of MEDIUM would the customer like?"
medium_total = MEDIUM*gets.chomp.to_f
puts "How many packs of BOLD would the customer like?"
MAX = 1000
NUM = rand(1000)
puts "Guess a number between 0 and #{MAX}"
guess = gets.chomp.to_i
def guess_again
guess = gets.chomp.to_i
if guess == NUM
puts "CORRECT!"
create mode 100644 config/initializers/backtrace_silencers.rb
commit 620ea8f6c9313a120735015c1b2e8abe61439055
Author: Justus Danny Eapen Jr <[email protected]>
Date: Fri Nov 15 10:22:53 2013 -0500
First Commit
(END)
class Product
@@all = []
def initialize (item, price)
@item = item
@price = price
end
def price
@price
SCORES = [75,
100,
85,
65,
84,
87,
95]
def average
sum = 0
salutations = [
'Mr.',
'Mrs.',
'Mr.',
'Dr.',
'Ms.'
]
first_names = [
'John',
require 'pry'
class Product
@@all = []
def initialize (item, price)
@item = item
@price = price
end
word_bank = ["Array", "Hash", "Ruby", "Rails", "Framework", "Werewolf", "Mafia", "Koans", "Launch", "Class", "Object", "Database", "Schema", "Spock", "Method", "Constant", "Higgs-Boson", "Regulatory Capture", "git", "Gist", "Github", "Gem", "Directory", "Binary", "Backchannel", "Socket", "Bootstrap", "Javascript", "CSS", "HTML", "Markdown", "initialize", "attribute", "Airplay", "User Story", "Acceptance Criteria", "Batman", "Java", "Language", "Mirepoix", "Perl", "Python", "Recursive Loop",]
secret_word = word_bank[rand(word_bank.length)]
secret_word = secret_word.downcase
blanked_word = ""
array_word = secret_word.each_char.to_a
array_word.each do |char|
departures =
{"Train 1" => 2,
"Train 2" => 5,
"Train 3" => 7.5,
"Train 4" => 8.5,
"Train 5" => 9,
"Train 6" => 10,
"Train 7" => 11.5,
"Train 8" => 13.5,
"Train 9" => 14.5,