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 ActiveRecord::Base | |
| mattr_accessor :shared_connection | |
| @@shared_connection = nil | |
| def self.connection | |
| @@shared_connection || retrieve_connection | |
| 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
| import hypermedia.video.Blob; | |
| import java.awt.Rectangle; | |
| public class BlobSizeComparator implements java.util.Comparator<Blob> { | |
| public int compare(Blob a, Blob b) { | |
| Rectangle boundingA = a.rectangle; | |
| Rectangle boundingB = b.rectangle; | |
| double areaA = boundingA.getHeight() * boundingA.getWidth(); | |
| double areaB = boundingB.getHeight() * boundingB.getWidth(); |
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
| // OO-ish | |
| function Car(manufacturer, model) { | |
| this.manufacturer = manufacturer; | |
| this.model = model; | |
| } | |
| var porsche = new Car('Porsche', 'Carrera'); | |
| var ferrari = new Car('Ferrari', 'Enzo'); |
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
| "pt-BR": | |
| errors: | |
| messages: | |
| not_found: "não encontrado" | |
| already_confirmed: "já foi confirmado" | |
| not_locked: "não foi bloqueado" | |
| not_saved: | |
| one: '1 erro impediu que %{model} fosse gravado:' | |
| other: '%{count} erros impediram que %{model} fosse gravado:' |
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 'net/imap' | |
| Net::IMAP.debug = true | |
| imap = Net::IMAP.new('imap.gmail.com', :ssl => true) | |
| imap.login('login', 'senha') | |
| imap.select('INBOX') | |
| loop do | |
| seqno = 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
| grupos que sei da existência: | |
| * Guru-SP | |
| * Guru-SP-Interior | |
| * Guru-Campinas (SP) | |
| * Guru-CE | |
| * Guru-PI | |
| * Rails-MG | |
| * Guru-SC | |
| * Guru-BA |
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
| Factory.define :user do |u| | |
| u.email '[email protected]' | |
| 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
| guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' }, :cucumber => false do | |
| watch('config/application.rb') | |
| watch('config/environment.rb') | |
| watch(%r{^config/environments/.+\.rb$}) | |
| watch(%r{^config/initializers/.+\.rb$}) | |
| watch('spec/spec_helper.rb') | |
| end | |
| guard 'rspec', :cli => '--drb' do | |
| watch(%r{^spec/.+_spec\.rb}) |
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
| group :test do | |
| gem 'guard-spork' | |
| gem 'guard-rspec' | |
| gem 'growl' | |
| gem 'rb-fsevent' | |
| 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
| module Support | |
| module Login | |
| def login(user=nil) | |
| user ||= users(:user) | |
| visit new_session_path | |
| # ... | |
| end | |
| end | |
| end |