Skip to content

Instantly share code, notes, and snippets.

View fytzzz's full-sized avatar

fytzzz fytzzz

View GitHub Profile
{
"alignment_chars" : ["=", ":"]
}
# 更换源
comment_lines "Gemfile", /source .http.*/
add_source "http://ruby.taobao.org"
# HTML模板
gem 'slim'
# 单点登录
gem 'rubycas-client'
# Use /download as our temporary download directory
# Start download and install freetds
cd /download
# Offical Site: freetds.org
wget ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz
tar zxvf freetds-0.91
cd freetds-0.91
./configure
make
make install
group :development do
gem 'heroku', '2.1.4'
gem 'jquery-rails', '1.0.2'
gem 'rspec-rails', '2.6.1'
gem 'cucumber-rails', '0.4.1'
gem 'factory_girl_rails', '1.0.1'
gem 'capybara', '0.4.1.2'
gem 'delorean', '1.0.0'
gem 'mocha', '0.9.12'
@fytzzz
fytzzz / gist:3186915
Created July 27, 2012 08:56 — forked from insane-dreamer/gist:523774
access current_user in an Observer
class ApplicationController < ActionController::Base
before_filter :set_current_user
private
def set_current_user
UserActionObserver.current_user = current_user
end
end
class UserActionObserver < ActiveRecord::Observer
# assuming these all have created_by_id and updated_by_id
@fytzzz
fytzzz / install-sqlite.sh
Created July 23, 2012 15:47 — forked from fabrizioc1/install-sqlite.sh
Installing sqlite3 in CentOS for use with ruby-sqlite3
# The YUM package is too old for use with ruby-sqlite3, use the autoconf package from www.sqlite.org
cd /opt
wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
tar xvzf sqlite-autoconf-3070701.tar.gz
ln -s /opt/sqlite-autoconf-3070701 /opt/sqlite3
cd /opt/sqlite3
./configure --prefix=/opt/sqlite3
make
make install
# Shared library will be installed in /usr/local/lib.
#Steps to install RVM + Ruby 1.9.2 + Rails + nginx + Passenger on CentOS (tested on v5.5)
# Install git and curl, if not already installed
sudo yum install git
sudo yum install curl
# Create the rvm group and add any users who will be using rvm to the group
sudo su -
groupadd rvm