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 Fruit | |
class Apple | |
attr_reader :variety, :created_at | |
def initialize(variety = default_variety) | |
@variety = variety | |
@created_at = Time.now | |
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
puts "Welcome to Scrabble" | |
class Scrabble | |
def self.score(word) | |
one_point_group = %w[ A E I O U L N R S T ] | |
two_point_group = %w[ D G ] | |
three_point_group = %w[ B C M P ] | |
four_point_group = %w[ F H V W Y ] | |
five_point_group = %w[ K ] | |
eight_point_group = %w[ J X ] |
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
title "Example Presentation" | |
description "Several parade examples to assist with showing others how to get started with Parade" | |
pause_message "Visit github.com/schacon/parade" | |
resources "resources" | |
section "Introduction" do |
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
export CLICOLOR=1 | |
export TERM=xterm-color | |
export LSCOLORS=fxfxcxdxbxegedabagacad | |
export HISTCONTROL=ignoredups:erasedups | |
export PATH=/usr/local/bin:/usr/local/sbin:$PATH | |
export PATH=/usr/local/Cellar/wkhtmltopdf/0.9.9:$PATH | |
export PATH=/usr/local/share/npm/bin:$PATH | |
export PATH=.:$PATH |
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 Point < Struct.new(:x,:y) | |
def self.at(x,y) | |
new x, y | |
end | |
def ==(other) | |
other.x == x and other.y == y | |
end | |
def around |
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
export CLICOLOR=1 | |
export TERM=xterm-color | |
export LSCOLORS=fxfxcxdxbxegedabagacad | |
export HISTCONTROL=ignoredups:erasedups | |
export PATH=/usr/local/bin:/usr/local/sbin:$PATH | |
export PATH=/usr/local/Cellar/wkhtmltopdf/0.9.9:$PATH | |
export PATH=/usr/local/share/npm/bin:$PATH | |
export PATH=.:$PATH |
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 Allergies | |
def initialize(score) | |
@score = score | |
end | |
attr_reader :score | |
def allergens |
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 String | |
def char_counts_hash | |
char_hash = Hash.new(0) | |
each_char {|char| char_hash[char] += 1 } | |
char_hash | |
end | |
def anagram_of?(word) | |
word.char_counts_hash == char_counts_hash | |
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
require 'spec_helper' | |
describe ApplicationController do | |
describe "#require_login" do | |
context "when the user is logged in" do | |
it "does nothing" do | |
end | |
end | |
context "when the user is not logged in" do |
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 SumOfMultiples | |
def self.to(input) | |
new(3,5).to(input) | |
end | |
def initialize(*params) | |
@params = params | |
end |