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
module A | |
class Payment | |
def foo | |
p "Payment#foo" | |
end | |
end | |
end | |
module A | |
class CC < Payment |
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
sudo ifconfig en1 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` |
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
var Class = function(parent){ | |
var klass = function(){ | |
this.init.apply(this, arguments); | |
} | |
if(parent){ | |
var subclass = function(){}; | |
subclass.prototype = parent.prototype; | |
klass.prototype = new subclass; |
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
# Based on robbyrussell's theme, with host and rvm indicators. Example: | |
# @host ➜ currentdir rvm:(rubyversion@gemset) git:(branchname) | |
# Get the current ruby version in use with RVM: | |
if [ -e ~/.rvm/bin/rvm-prompt ]; then | |
RUBY_PROMPT_="%{$fg_bold[blue]%}[%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt)%{$fg_bold[blue]%}]%{$reset_color%} " | |
fi | |
# Get the host name (first 4 chars) | |
HOST_PROMPT_="%{$fg_bold[red]%}➜ %{$fg_bold[cyan]%}%0~ " |
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
# Centos 5.8 libyaml anoning warn message. | |
1 - rvm pkg install libyaml | |
2 - rvm reinstall all --force --with-opt-dir=~/.rvm/usr |
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
module ClearMethods | |
extend self | |
def __clear_methods | |
methods - Object.methods | |
end | |
end | |
class Object | |
include ClearMethods | |
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 load_remote_mysql_data{ | |
ssh '$user@$server' mysqldump $mrdb -u$mru -p$mrp | mysql $mldb -u$mlu -p$mlp | |
echo 'done!' | |
} |
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 add_alias { | |
echo "alias $1=\"$2\"" >> ~/.aliases | |
echo 'Reloading...' | |
sz | |
} | |
function show_my_aliases { | |
echo $my_aliases | sort | grep -e "^$" -v | |
} |
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
be rake db:migrate:down VERSION=$(ruby -e 'print Dir["./db/migrate/**"].last.match(/\/(?<s>\d+)/)[:s]') |
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
cd /tmp | |
git clone git://git.kernel.org/pub/scm/git/git.git | |
cd git | |
git checkout v`git --version | awk '{print $3}'` | |
cp contrib/completion/git-completion.bash ~/.git-completion.bash | |
cd ~ | |
rm -rf /tmp/git | |
echo -e "source ~/.git-completion.bash" >> .profile |