Skip to content

Instantly share code, notes, and snippets.

# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@jimmynotjim
jimmynotjim / gist:3291471
Created August 8, 2012 02:15
Another equal height columns script
// equalize height for content area with sidebar
var equalize = Math.max(
$('.main').height(),
$('.sidebar').height()
);
$('.content').height(equalize);
@juandazapata
juandazapata / mountain_lion_home_brew.md
Created July 26, 2012 15:07
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

After upgrading to Mountain Lion, I got this message when trying to run my local rails server:

Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    Users/user/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby extconf.rb
@mynameispj
mynameispj / field-swap.js
Created May 15, 2012 20:30
Swap text input for password input on focus / blur
$('input').focus(function() {
if ($(this).hasClass('passwordLabel')) {
$(this).hide();
$(this).next('input').show();
$(this).next('input').focus();
}
if (this.value == this.defaultValue){
this.value = '';
}
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#