Skip to content

Instantly share code, notes, and snippets.

View rinaldifonseca's full-sized avatar

Rinaldi Fonseca rinaldifonseca

View GitHub Profile
# Create a file `spec/acceptance/support/warden.rb' with the following
# contents:
Spec::Runner.configure do |config|
config.include Warden::Test::Helpers, :type => :acceptance
config.after(:each, :type => :acceptance) { Warden.test_reset! }
end
# Or, if you're using RSpec 2 / Rails 3, the contents should be the following
# instead:
app_name = ARGV[0].humanize
# Remove unwanted files
remove_file "public/index.html"
remove_file "public/favicon.ico"
remove_file "public/images/rails.png"
remove_file "public/robots.txt"
# Add gems to Gemfile
append_to_file 'Gemfile', %Q{
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
def transfere(to, valor)
to.link("transfer").post(:valor => valor)
end
def processa_pagamento(pessoa, aulas, consultorias, opensource, bank)
parcelas = []
total = 0
aulas.each do |a|
aula.verify do |v|
heffalump:~ james$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.1]
heffalump:~ james$ php -v
PHP 5.3.4 (cli) (built: Jan 17 2011 21:54:20)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
heffalump:~ james$ cat foo.rb
msg = "Hello world"
module Test
module Unit
TestCase = RSpec::Core::ExampleGroup
end
end
class Test::Unit::TestCase
def self.inherited(host)
host.set_it_up host.name.gsub(/(Spec|Test)/,'')
def host.method_added(name)
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
class Tupla <T> {
private final T esquerda;
private final T direita;
public Tupla(T esquerda, T direita) {
@rinaldifonseca
rinaldifonseca / bassie.png
Created April 29, 2011 02:00 — forked from jeffkreeftmeijer/bassie.png
Colored image blob detection
bassie.png
@rinaldifonseca
rinaldifonseca / config.ru
Created May 8, 2011 02:08 — forked from fnando/rubygems_proxy.rb
Rack app for caching RubyGems files. Very useful in our build server that sometimes fails due to our network or rubygems.org timeout.
require "./rubygems_proxy"
run RubygemsProxy
@rinaldifonseca
rinaldifonseca / rails_3_1_beta_1_changes.md
Created May 10, 2011 02:17 — forked from ryanb/rails_3_1_rc4_changes.md
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 Beta 1

  • The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]

  • jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]

  • Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]

  • The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]