Skip to content

Instantly share code, notes, and snippets.

@aurelian
aurelian / gist:534568
Created August 18, 2010 12:39
shows what before_filter is executed and where's that filter defined. useful to debug before_filter madness
puts "\033[1;31m=> Loading hacks: #{__FILE__}\033[0m"
module BeforeFilterHacks
def self.included(base)
base.class_eval { alias_method_chain :call, :hacks }
end
def call_with_hacks(controller, &block)
message= if method.kind_of?(Proc)
method.to_s

Keybase proof

I hereby claim:

  • I am aurelian on github.
  • I am aurelian (https://keybase.io/aurelian) on keybase.
  • I have a public key whose fingerprint is C2A7 DC09 A8A4 6FD3 8C8E D34C 718C EC43 D520 4F1D

To claim this, I am signing this object:

# Opens the github page for the current git repository and branch in your browser
#
# based on this: http://jasonneylon.wordpress.com/2011/04/22/opening-github-in-your-browser-from-the-terminal/
# + works with current branch
# + pass file: gh foo/bar.txt #=> https://github.com/o/o/tree/master/foo/bar.txt
# + pass commit sh: gh 5116fba #=> https://github.com/o/o/commits/5116fba
#
function gh() {
giturl=$(git config --get remote.origin.url)
if [ "$giturl" == "" ]
class Foo
def destroy
puts "destroyed!"
end
end
class Bar < Foo
private :destroy
Array.prototype.join = function(val) { var res = ""; var sep = (val === undefined)?"\0":val; this.forEach(function(el){ res+= el.toString() + sep }); return res.slice(0, -1*sep.length);}
ruby-1.9.3-p194 is not installed.
To install do: 'rvm install ruby-1.9.3-p194'
Running /Users/aurelian/.rvm/hooks/after_cd
belgorod /Projects/Code/october(master) $ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]
belgorod /Projects/Code/october(master) $ cat .rvmrc
rvm use 1.9.3
<form action="http://localhost:8199/search?done=1" method="get">
<input name="q">
<button>go
</form>
@aurelian
aurelian / tmux.conf
Created February 24, 2012 11:31
my ~/.tmux.conf
# vi mode
setw -g mode-keys vi
# prefix to ctrl-a
unbind C-b
set -g prefix C-a
# split horizontally with |
# and vertically with -
unbind %
# shell: bash-version 3.2.39
# .bash_profile
export EDITOR=vim
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [[ -s "~/.rvm/environments/ruby-1.9.2-p180@mygemset" ]] ; then
. "~/.rvm/environments/ruby-1.9.2-p180@mygemset"
else
rvm --create use "ruby-1.9.2-p180@mygemset" 1> /dev/null
fi
if ! which bundle 1>/dev/null ; then
rvm gemset import mygemset.gems
fi