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 ActiveSupport | |
module Cache | |
class MemoryStoreWithExpiry < MemoryStore | |
def initialize | |
super | |
@times = {} | |
end | |
def write(name, value, options = nil) |
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
# | |
# A bunch of files to migrate translation data from Globalize 1 (yuck) | |
# to use it with Globalize 2 (looks promising, much cleaner and simpler) | |
# | |
# I'll generalize, convert this into a plugin and document this | |
# if there's enough interest. | |
# | |
========== lib/tasks/globalize_migrator.rake | |
require File.join(File.dirname(__FILE__), '../../config/environment') |
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
Scenario: Full text search | |
Given there are 10 projects for API client "Payback" | |
When I call the API "project search" with data: | |
| search-term | page | per-page | | |
| afrika | 2 | 2 | | |
Then I should get status "200 OK" | |
And I should see a XML list of 2 projects |
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
# | |
# a smoke test to check basic programming skills | |
# | |
# Task: | |
# - print out the numbers 1 to 100 | |
# - output "foo" for every number divisible by 3 | |
# - output "bar" for every number divisible by 5 | |
# - output "foobar" for every number divisible by 3 and 5 | |
# |
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
funkyness = lambda { |number| puts "FUNKY! " * number } | |
(1..10).each(&funkyness) | |
FUNKY! | |
FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! |
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
funkyness = ->(number){ puts "FUNKY! " * number } | |
(1..10).each(&funkyness) | |
FUNKY! | |
FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! | |
FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! FUNKY! |
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
10:20 Intro | |
10:30 Patterns in Architecture Joseph Yoder Stanford Architecture http://qconsf.com/sf2009/presentation/Patterns+in+Architecture | |
11:45 Kanban vs Scrum - a practical guide Henrik Kniberg Metro Ballroom Lean/Kanban http://qconsf.com/sf2009/presentation/Kanban+vs+Scrum+-+a+practical+guide | |
13:45 adventures of an agile architect Dan North Stanford Architecture http://qconsf.com/sf2009/presentation/Adventures+of+an+Agile+Architect | |
15:00 Roadmap to Continuous Deployment Nathan Dye Stanford Architecture http://qconsf.com/sf2009/presentation/Roadmap+to+Continuous+Deployment | |
16:30 Rails in the Large ... Neil Ford Cornell Facets of Ruby http://qconsf.com/sf2009/presentation/Rails+in+the+Large%3A+How+Agility+Allows+Us+to+Build+One+of+the+World%27s++Biggest+Rails+Apps | |
18:00 The State and future of JavaScript Douglas Crockford http://qconsf.com/sf2009/ |
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
# | |
# CONTROLLER | |
# | |
# POST /admin/voucher_set | |
class Admin::VoucherSetController < ... | |
def create | |
VoucherSet.create!(params) | |
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 'test/unit' | |
def factorial(max) | |
(1..max).inject(1) { |sum, current| sum *= current; sum } | |
end | |
class FactorialTest < Test::Unit::TestCase | |
def test_factorial_0_is_1 | |
assert_equal 1, factorial(0) |
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 'test/unit' | |
def f(x); x != 0 && x * f(x - 1) || 1; end | |
class FactorialTest < Test::Unit::TestCase | |
def test_factorial_0_is_1 | |
assert_equal 1, f(0) | |
end |
OlderNewer