Skip to content

Instantly share code, notes, and snippets.

View raphaelcosta's full-sized avatar

Raphael Costa raphaelcosta

View GitHub Profile
# Hi! I'am rack middleware!
# I was born for show right way to you JavaScript
# My author's name was Aleksandr Koss. Mail him at kossnocorp@gmail.com
# Nice to MIT you!
require(File.dirname(__FILE__) + '/../config/environment') unless defined?(Rails)
class RoutesJs
def initialize app, options = {}
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
# Hi! I'am rack middleware!
# I was born for show right way to you JavaScript
# My author's name was Aleksandr Koss. Mail him at kossnocorp@gmail.com
# Nice to MIT you!
require(File.dirname(__FILE__) + '/../config/environment') unless defined?(Rails)
class RoutesJs
def initialize app, options = {}
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@tomas-stefano
tomas-stefano / ruby_patch.sh
Created July 2, 2011 18:37
Ruby require 1.9.2 patch and installation
## This is how I installed ruby in my Mac ##
## Will install a ruby 1.9.2-p180-patched #
$ curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > /tmp/load.patch
$ rvm install ruby-1.9.2-p180 --patch /tmp/load.patch -n patched
#### If you have problems with Ruby::
@croaky
croaky / gist:1089598
Created July 18, 2011 14:01
Transfer data from production to staging on Heroku
heroku addons:add pgbackups --remote staging
heroku addons:add pgbackups --remote production
heroku pgbackups:capture --remote production
heroku pgbackups:restore DATABASE `heroku pgbackups:url --remote production` --remote staging
@mindscratch
mindscratch / rails_app_ssl_monkey_patch.rb
Created August 15, 2011 09:32
Rails (3.0.x): request.ssl? isn't working -- monkey patch
class Application < Rails::Application
# MONKEY PATCH
#
# Calls to request.ssl? aren't working. The ssl? method relies on some environment variable(s)
# to be set and doesn't take into account the 'rack.url_scheme'. See ticket #5750 on the Rails
# lighthouseapp.com ticketing site.
# url: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5750-requestssl-should-reflect-rackurl_scheme
def call(env)
@activefx
activefx / spec_helper.rb
Created October 10, 2011 20:19
Spec helper for use with guard, spork, rspec, factory girl, devise, capybara, and mongoid
require 'rubygems'
def start_simplecov
require 'simplecov'
SimpleCov.start 'rails' unless ENV["SKIP_COV"]
end
def spork?
defined?(Spork) && Spork.using_spork?
end
/* Mixins
================================================== */
@mixin placeholder-color($color: $grayLight) {
:-moz-placeholder { color: $color; }
::-webkit-input-placeholder { color: $color; }
}
// Border Radius
@sethbro
sethbro / test_helper.rb
Created January 13, 2012 18:19
MiniTest::Spec with Rails setup
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/autorun'
require 'minitest/pride'
require 'capybara/rails'
class MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown