Skip to content

Instantly share code, notes, and snippets.

View josepjaume's full-sized avatar

Josep Jaume Rey josepjaume

View GitHub Profile
source 'http://rubygems.org'
gem 'rails', :git=>'git://github.com/rails/rails.git', :branch=>'3-0-stable'
gem 'arel', :git=>'git://github.com/rails/arel.git'
gem "compass", ">= 0.10.5"
gem "haml"
gem "will_paginate", "3.0.pre2"
gem "devise"#, :git=>'git://github.com/plataformatec/devise.git'
gem "devise_invitable", :git=>"git://github.com/scambra/devise_invitable.git"
gem "high_voltage"
@josepjaume
josepjaume / button.rb
Created January 25, 2011 09:14
Replaces input type="submit" form elements with button
module ActionView
module Helpers
def submit_tag(value = "Save changes", options = {})
options.stringify_keys!
if disable_with = options.delete("disable_with")
options["data-disable-with"] = disable_with
end
if confirm = options.delete("confirm")
@josepjaume
josepjaume / vim.rb
Created February 7, 2011 15:20 — forked from uasi/vim.rb
require 'formula'
class Vim <Formula
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
homepage 'http://www.vim.org/'
md5 '5b9510a17074e2b37d8bb38ae09edbf2'
version '7.3.112'
def patchlevel; 112 end
def features; %w(tiny small normal big huge) end
@josepjaume
josepjaume / qt.rb
Created May 17, 2011 13:06
QT Head Formula
require 'formula'
require 'hardware'
class Qt < Formula
url 'http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.tar.gz'
md5 '49b96eefb1224cc529af6fe5608654fe'
homepage 'http://qt.nokia.com/'
head 'git://gitorious.org/qt/qt.git', :branch => 'master-stable'
def options
@josepjaume
josepjaume / gist:1188097
Created September 2, 2011 07:32
Install patched ruby 1.9.2-p290
rvm uninstall 1.9.2
wget https://gist.github.com/raw/1156873/6343983e3ac418b3f0f59e9b3c38a5a5e5b0915a/gistfile1.sh -O - | sh
rvm gemset use global
gem install bundler
rvm reload
@josepjaume
josepjaume / gist:1206106
Created September 9, 2011 12:40
Time comparison inconsistency with SQLite, PostgreSQL and MySQL with ActiveRecord
def pending_notifications
notifications = self.notifications
if last_notification_read_at
# Sqlite doesn't properly compare dates because doesn't have a dedicated
# type for it.
# TODO: Investigate further and find a better solution for this.
#
time_restriction = if connection.class.name.demodulize =~ /SQLite/
@josepjaume
josepjaume / backbone-form-builder-interface.js
Created January 5, 2012 17:13
backbone-form-builder idea
var model = new Backbone.Model.extend();
// The form would bind to the model's "error" event.
// Any error retrieved from the JSON response or js
// validations would be captured.
//
// Sending the form would simply call the model's
// 'save' function with its serialized attributes
// and therefore would either render the errors or
// fire up the 'success' callback.
@josepjaume
josepjaume / gist:3052389
Created July 5, 2012 08:49
Install mint
sudo apt-get install -y rubygems1.9
sudo gem1.9.1 install compass
echo PATH="/var/lib/gems/1.9.1/bin/:$PATH" >> ~/.profile
@josepjaume
josepjaume / .gitignore
Created July 5, 2012 10:59
SASS & Compass exercises
.sass-cache
./stylesheets
@josepjaume
josepjaume / Gemfile
Created August 10, 2012 09:37
Spinach and VCR
gem 'webmock'
gem 'vcr'