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 MagicProxy | |
@methods = [] | |
def self.method_missing(method) | |
@methods << method | |
# Put magic here! | |
puts @methods.join('.') | |
self | |
end | |
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 "authlogic/test_case" | |
World(Authlogic::TestCase) | |
Before do | |
@cookies = ActionDispatch::Cookies::CookieJar.new(Rails.application.config.secret_token) | |
Authlogic::TestCase::MockCookieJar.stub(:new).and_return{ @cookies } | |
ActionDispatch::Request.any_instance.stub(:cookies).and_return{ @cookies } | |
ActionDispatch::Request.any_instance.stub(:cookie_jar).and_return{ @cookies } |
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
71.205.214.254 - - [19/Jul/2011:00:01:43 +0000] "GET /buttons/OV5a-bMRyaFfCUMiElKvCA.png HTTP/1.1" 404 313 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30" |
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
Feature: Chat | |
As a user | |
I want to chat with other users | |
So I feel like part of a community | |
@javascript | |
Scenario: Push for chat | |
Given the following users exist: | |
| name | | |
| Steve | |
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
[NilClass, TrueClass, FalseClass].each do |klass| | |
klass.class_eval do | |
def as_json(options = nil) | |
self | |
end | |
end | |
end | |
ActiveSupport::JSON::Encoding::Encoder.class_eval do | |
def encode(value, use_options = true) |
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
source "http://rubygems.org" | |
gem "rails", "3.0.7" | |
gem "pg" | |
gem "jquery-rails", "~> 1.0.7" | |
gem "faye", "~> 0.6.0" | |
group :development, :test 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
# Initialize new Triple DES, CBC cipher with PKCS5 padding | |
cipher = Cipher.new | |
# Begin | |
cipher.encrypt | |
# Pass in encryption key, as given: "...rbtrj" | |
cipher.key = "KEY" | |
# Pass in initialization vector, as given: "...gdf=" |
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
SCREEN 12: CLS : xs = 1: ys = 1: x = 25: y = 25 | |
1 CIRCLE (xx, yy), 20, 0: CIRCLE (x, y), 20, 15 | |
DO: s = s + 1: IF s = 30 THEN s = 0: EXIT DO | |
LOOP: xx = x: yy = y: x = x + xs: y = y + ys | |
IF x < 25 OR x > 615 THEN xs = -xs | |
IF y < 25 OR y > 455 THEN ys = -ys | |
GOTO 1 |
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
' *This is the FIRST succesful "Bounce" program. This is THE original (other * | |
' *than the lines you're reading) so please make NO changes to the program.* | |
1 SCREEN 11 | |
2 CLS | |
5 FOR z = 0 TO 20 STEP 20 | |
10 CIRCLE (x, y), z | |
15 NEXT z | |
20 x = x + 4 | |
21 y = y + 4 | |
23 IF y > 432 THEN 32 |
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
# 2010-10-01 | |
# | |
# Mac OS X 10.6.3 | |
# Homebrew 0.7 | |
# Xcode 3.2.4 | |
# Git 1.7.3.1 | |
# RVM 1.0.12 | |
# Ruby 1.9.2, 1.8.7 | |
# Rails 3.0.0 | |
# Passenger 3.0.0.pre4 |