Skip to content

Instantly share code, notes, and snippets.

View rafaelfranca's full-sized avatar
🚆
Focused on Rails

Rafael Mendonça França rafaelfranca

🚆
Focused on Rails
View GitHub Profile
@fnando
fnando / rubygems_proxy.rb
Created April 28, 2011 22:54
Rack app for caching RubyGems files. Very useful in our build server that sometimes fails due to our network or rubygems.org timeout.
# Moved to its own repo: http://github.com/fnando/rubygems_proxy
@timblair
timblair / caveatPatchor.js
Created February 15, 2011 10:27 — forked from protocool/caveatPatchor.js
Sample caveatPatchor.js file for use in Propane 1.1.2 and above: pulls avatars from Gravatar
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
require 'spec_helper'
require 'steak'
require 'capybara/rails'
require 'database_cleaner'
require 'akephalos'
DatabaseCleaner.strategy = :truncation
Capybara.default_selector = :css
class ActiveRecord::Base
@dcrec1
dcrec1 / matchers.rb
Created September 17, 2010 22:38
Rails3 RSpec matchers
def should_be_delivered_on_creation_with(clazz)
context "on creation" do
it "should be send on an email" do
mailer = mock(clazz)
clazz.should_receive(subject.class.to_s.underscore).with(an_instance_of(subject.class)).and_return(mailer)
mailer.should_receive :deliver
Factory subject.class.to_s.underscore
end
end
end
require "spec/acceptance/acceptance_helper"
feature "Login", %q{
In order to access my account
As an user
I want to be able to log in
} do
let :user do
Factory :user
@kneath
kneath / _README.md
Created November 18, 2009 21:42 — forked from defunkt/bundle.rake
Intelligent asset bundling for Rails (GitHub's asset bundling)

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js