Skip to content

Instantly share code, notes, and snippets.

View matflores's full-sized avatar

Matías Flores matflores

View GitHub Profile
@matflores
matflores / quiz.rb
Created May 16, 2009 02:41 — forked from ryanb/quiz.rb
# COMMUNITY CHALLENGE
#
# How would you test this Quiz#problem method? Only two rules:
#
# 1. The tests should fail if any part of the application breaks.
# For example: If "gets" is moved before "puts" then the tests should
# fail since that breaks the application.
#
# 2. You cannot change the Quiz class. But you can use whatever framework
# and tools you want for the tests. (RSpec, Cucumber, etc.)
From 148b0afa9c8decdf24e859393277d5ed56bf1e49 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Mat=C3=ADas=20Flores?= <mflores@atlanware.com>
Date: Fri, 29 Jan 2010 17:01:39 -0300
Subject: [PATCH] Return the received object if scopes configuration is nil
---
lib/has_scope.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/has_scope.rb b/lib/has_scope.rb
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. For a detailed explanation
# and listing of configuration options, please view the documentation
# online.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "lucid32"
config.vm.network = "192.168.100.100"
# Enable the chef solo provisioner
@matflores
matflores / settings.rb
Created September 9, 2010 19:39 — forked from cyx/settings.rb
# config/settings.rb
Main.config do |m|
m.site_name = 'Cool site'
m.smtp.domain = "..."
m.smtp.host = "..."
m.s3.access_key = "...."
m.s3.secret_access_key = "...."
script "install everything" do
interpreter "bash"
user "root"
cwd "/vagrant"
code "bash setup.sh"
end
# inside class Protest::TestCase
class << self
alias original_scenario scenario
def scenario(name, options = {}, &block)
original_scenario(name) do
old_driver, Capybara.current_driver = Capybara.current_driver, options[:driver] || Capybara.current_driver
instance_eval(&block)
def find(options)
Set.new(sinter(*keys(options)), Wrapper.wrap(model))
end
def except(options)
Set.new(sdiff(*keys(options)), Wrapper.wrap(model))
end
.listing-section(id="#{name}-section")
.listing-header
.listing-title= title
.listing-counter= counter
.listing-actions
- listing_actions.each do |action|
!~ render_listing_action(action, name)
.listing-inner
.table-block(id="#{name}-list" class="#{extra_class}")
From b89f9514facc348091074ca360e57a5ef9ab94e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C3=ADas=20Flores?= <mflores@atlanware.com>
Date: Thu, 7 Apr 2011 14:36:16 -0300
Subject: [PATCH 1/2] Add missing semi-colons
---
ui.watermark.js | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/ui.watermark.js b/ui.watermark.js
defaults: &defaults
adapter: sqlite3
timeout: 5000
development:
<<: *defaults
database: db/development.sqlite3
test:
<<: *defaults