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
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. | |
/Users/michaelverdi/.rvm/rubies/ree-1.8.7-2011.12/bin/ruby extconf.rb | |
checking for libxml/parser.h... yes | |
checking for libxslt/xslt.h... yes | |
checking for libexslt/exslt.h... yes | |
checking for iconv_open() in iconv.h... no | |
checking for iconv_open() in -liconv... yes | |
checking for xmlParseDoc() in -lxml2... yes | |
checking for xsltParseStylesheetDoc() in -lxslt... yes |
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
module CheckedAttributes | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def attr_checked(attribute, &validation) | |
define_method "#{attribute}=" do |value| | |
raise 'Invalid attribute' unless validation.call(value) | |
instance_variable_set("@#{attribute}", value) |
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 GuessingGame | |
def initialize(answer) | |
@answer = answer | |
@solved = false | |
end | |
def guess(number) | |
return "Answer is already known" if @solved | |
if number > @answer | |
:high |
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
#InvoiceItem Class | |
def self.filter_by_item(item_id) | |
InvoiceItem.all_successful.select { |ii| ii.item_id == item_id } | |
end | |
def self.revenue_per_item(item_id) | |
filter_by_item(item_id).collect { |ii| ii.unit_price * ii.quantity }.inject(:+) | |
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 Encryptor | |
def cipher(rotation) | |
characters = (' '..'z').to_a | |
rotated_characters = characters.rotate(rotation) | |
Hash[characters.zip(rotated_characters)] | |
end | |
def encrypt_letter(letter,rotation) | |
lowercase_letter = letter.downcase | |
cipher_for_rotation = cipher(rotation) |
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
function newspaper(name, left, top, width, height) { | |
this.name = name; | |
this.left = left; | |
this.top = top; | |
this.width = width; | |
this.height = height; | |
} | |
var nyTimes = new newspaper('nytimes', 200, 440, 1400, 800); | |
var laTimes = new newspaper('latimes', 500, 200, 1000, 900); |
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
function newspaper(name, left, top, width, height) { | |
this.name = name; | |
this.left = left; | |
this.top = top; | |
this.width = width; | |
this.height = height; | |
} | |
var nyTimes = new newspaper('nytimes', 200, 440, 1400, 800); | |
var laTimes = new newspaper('latimes', 500, 200, 1000, 900); |
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
fizzbuzz = Proc.new do |n| | |
if n % 15 == 0 | |
puts "fizzbuzz" | |
elsif n % 3 == 0 | |
puts "fizz" | |
elsif n % 5 == 0 | |
puts "buzz" | |
else | |
puts n | |
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
1 | |
mission statement | |
why program | |
intros - kids | |
why pomo | |
2 | |
instructor intro | |
pbj |
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
Main ingredients | |
6 tomatoes (roma, beefsteak, w/e) | |
3 carrots | |
2 bulbs of garlic | |
1 bag frozen corn | |
1 medium onion | |
random stuff | |
olive oil | |
veggie broth |