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 RPNCalculator | |
attr_accessor :calculator, :result, :subtotal, :mini_array | |
def initialize | |
@calculator = [] | |
@mini_array = [] | |
@result = 0 | |
@subtotal = 0 | |
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
class Array | |
def new_collect | |
self.collect do |n| | |
yield n | |
end | |
end | |
end | |
RSPEC: |
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 Array | |
def new_inject | |
result = 0 | |
(1..self.length).each do |i| | |
result = yield(result, self[i-1]) | |
end | |
result |
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 game(match) | |
if match[0][1].upcase =="R" | |
if match[1][1].upcase == "P" | |
match[1] | |
elsif match[1][1].upcase == "S" | |
match[0] | |
else | |
"It's a Tie!" | |
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
# Dependencies | |
require "csv" | |
require 'sunlight' | |
# Class Definition | |
class EventManager | |
INVALID_ZIPCODE = "00000" | |
INVALID_PHONE_NUMBER = "0000000000" | |
Sunlight::Base.api_key = "e179a6973728c4dd3fb1204283aaccb5" | |
def initialize(filename) |
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 Array | |
def new_collect | |
result = [] | |
self.each do |index| | |
result << yield(index) | |
end | |
result | |
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
class Board | |
def initialize(board_input) | |
@board_array = [] | |
board_input.split(//).each_with_index do |cell, index| | |
@board_array << Cell.new(cell, index) | |
end | |
end | |
def find_box(cell_id) |
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
puts "Welcome to console mad libs! First you'll enter 21 words, then you'll get a fun story, made by you!" | |
puts | |
goodAnswer = false | |
while (not goodAnswer) | |
puts "Are you ready to play? Type in 'yes' to begin." | |
ready = gets.chomp.downcase | |
if (ready == 'yes') | |
goodAnswer = true | |
else |
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 'twilio-ruby' | |
class Texter | |
def initialize | |
@account_sid = 'xxx' | |
@auth_token = 'xxx' | |
@client = Twilio::REST::Client.new(@account_sid, @auth_token) | |
@from = 'xxx' | |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ --> | |
<!-- Active URL: http://socrates.devbootcamp.com/sql.html --> | |
<sql> | |
<datatypes db="mysql"> | |
<group label="Numeric" color="rgb(238,238,170)"> | |
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/> | |
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/> | |
<type label="Single precision" length="0" sql="FLOAT" quote=""/> | |
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/> |