Skip to content

Instantly share code, notes, and snippets.

@jacquescrocker
jacquescrocker / Gemfile
Created June 23, 2011 16:23
compass hack for rails 3.1
gem 'sass-rails', :git => "https://github.com/rails/sass-rails.git"
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
@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]

@pamelafox
pamelafox / Makefile
Created April 25, 2011 19:09
JS/CSS Compressor Makefile
# Javascript/CSS Compressor Makefile
# Original by Benjamin "balupton" Lupton (MIT Licenced)
# Modified by Pamela Fox
MAKEFLAGS = --no-print-directory --always-make
MAKE = make $(MAKEFLAGS)
BUILDDIR = ./.build
CLOSUREURL = http://closure-compiler.googlecode.com/files/compiler-latest.zip
@drewlesueur
drewlesueur / sync_forked.md
Created April 17, 2011 04:28
How to sync your forked branch

This is how I synced my forked underscore.js repo with the original repo
From your forked repo:

git checkout -b upstream/master
git remote add upstream git://github.com/documentcloud/underscore.git
git pull upstream master
git checkout master                          // [my master branch]
git merge upstream/master (git rebase upstream/master ????)
git push origin master
@patmaddox
patmaddox / My question.txt
Created April 11, 2011 23:07
Question about case-insensitive columns in Rails
Hola Rails people. I have a column in my database that I need to treat
as case-insensitive. The standard solution to this is to downcase the
value before inserting it into the database, and when doing
searches. My problems with this are:
1. I have to make calls to String#downcase in several places where I
*really* mean "this is case-insensitive"
2. I can only provide automatic-downcasing when going through the API
I provide. Anyone calling MyClass.where(:name => foo) has to know to
@eric1234
eric1234 / 0_instructions.txt
Created April 9, 2011 01:12
Using Sprockets 2 in Rails 3.0.x with CoffeeScript & SASS
UPDATE: Please see some of the forks for an updated version of this guide. I
myself have moved onto the Rails 3.1 betas to get the asset pipeline. But if
you want to stay on stable there are other folks who are keeping this guide
relevant despite the changes constantly occurring on Sprockets 2. The comments
on this gist will lead you to the right forks. :)
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
This stuff will be native in Rails 3.1 and the layout of the files on the
@chrisyoung
chrisyoung / gist:853968
Created March 4, 2011 01:14
Cucumber Environment
# RVM: ruby-1.8.7-p330
# Culerity runs JRuby V1.5.6
# Everything is 64 bit on OSX
###### custom_env.rb
require File.expand_path(File.dirname(__FILE__) + '/../../config/factories')
require 'delorean'
ActiveRecord::TestCase.use_concurrent_connections
@trydionel
trydionel / backbone.rails.js
Created November 28, 2010 16:47
Makes Backbone.js play nicely with default Rails setup
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.
@guenter
guenter / move_to_rds.rb
Created November 11, 2010 02:14
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'
class AppBuilder < Rails::AppBuilder
include Thor::Actions
include Thor::Shell
def test
append_test_gems
rspec
cucumber
jasmine
end