This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./configure --enable-shared --enable-pthread --enable-install-doc \ | |
| --with-readline-dir=/usr/local CFLAGS=-D_XOPEN_SOURCE=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -O ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz | |
| tar xzf readline-5.2.tar.gz | |
| cd readline-5.2 | |
| ./configure && make && sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -O http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p160.tar.gz | |
| tar xzf ruby-1.8.7-p160.tar.gz | |
| cd ruby-1.8.7-p160 | |
| curl http://gist.github.com/98109.txt | patch -p0 | |
| ./configure --enable-shared --enable-pthread --enable-install-doc \ | |
| CFLAGS=-D_XOPEN_SOURCE=1 | |
| make | |
| sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.zsh/config | |
| export GEMPATH=`gem env gemdir` # we should cache this call | |
| # ~/.zsh/functions/gemdoc | |
| open $(echo $GEMPATH/doc/$1*(om[1]))/rdoc/index.html | |
| # ~/.zsh/functions/_gemdoc | |
| #compdef gemdoc | |
| _files -W $GEMPATH/doc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.zsh/aliases | |
| alias ez="mvim -f ~/.zshrc +1 \"+set syntax=sh\" \"+Sex ~/.zsh\" \ | |
| && echo Sourcing... \ | |
| && source ~/.zshrc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ArticlesController < ActionController::Base | |
| helper_method :articles, :article | |
| # render index, show, new, edit | |
| def create | |
| article.save! | |
| redirect_to articles_path | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.bash_profile | |
| sg() { | |
| local migration=`script/generate $@ | awk ' /db\/migrate\//{print $NF}'` | |
| if [ $migration ]; then $EDITOR $migration && rake db:migrate; fi | |
| } | |
| alias sgmo="sg model $@" | |
| alias sgmi="sg migration $@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.bash_profile | |
| export GEMDIR=`gem env gemdir` | |
| gemdoc() { | |
| local gems=($GEMDIR/doc/$1*/rdoc/index.html) | |
| open ${gems[@]: -1} | |
| } | |
| complete -W '$(`which ls` $GEMDIR/doc)' gemdoc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # config/environments/production.rb | |
| config.action_controller.asset_host = Proc.new { |path| | |
| 'assets.example.com' if Time.at(path[/\d+$/].to_i) < 1.hour.ago | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function_with_string_arg_and_hash_arg(<<-STRING, :key => value) | |
| The string | |
| can go | |
| here | |
| STRING |