This file contains 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
def http_authentication | |
super or '' | |
end | |
def authenticate! | |
super | |
end | |
end | |
Warden::Strategies.add(:http_auth_non_html, HttpAuthenticatableNonHtml) | |
# Use this hook to configure devise mailer, warden hooks and so forth. The first |
This file contains 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
# 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: |
This file contains 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
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{ |
This file contains 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
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 |
This file contains 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
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| |
This file contains 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
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" |
This file contains 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 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) |
This file contains 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
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) { |

This file contains 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 "./rubygems_proxy" | |
run RubygemsProxy |
OlderNewer