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
# make gvim set its servername to the current dir | |
_basedir() { | |
basename `pwd` | |
} | |
alias gvim='/Applications/MacVim.app/Content/MacOS/Vim -g --servername $(_basedir)' |
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
# http://www.jroller.com/dscataglini/entry/speeding_up_method_missing | |
require 'benchmark' | |
include Benchmark | |
class A | |
def foo(a, b, c) | |
1 | |
end | |
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
module Upstream | |
module Streamer | |
def self.included(receiver) | |
receiver.extend ExtensionMethods | |
end | |
module ExtensionMethods | |
def streamable! | |
self.send :include, InstanceMethods |
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
MAC OS X: | |
*** ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.7.0] | |
user system total real | |
Symbol#to_proc 97.820000 26.180000 124.000000 (128.542748) | |
*** ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-darwin9.7.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
database: &database | |
adapter: mysql | |
username: <pwd> | |
password: <pwd> | |
host: localhost | |
encoding: utf8 | |
development: | |
<<: *database | |
database: <proj>_development |
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
#!/bin/sh | |
# | |
# Stupid script that handles big Rails logs in search for activation emails queued on DelayedJobs. | |
# Like I said, stupid. No more than the bug that created the need to do this, but still. | |
# | |
# And nevermind the name. I decided to look the web for inspiration and got an article on Ford, | |
# Chrysler and Lee Iacocca. Thus, iacocca.sh. | |
# | |
echo "spliting log file in 30M tempfiles..." |
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
#!/bin/bash | |
# Font: http://scott.sherrillmix.com/blog/programmer/syntax-highlighting-in-terminal/ | |
if [ ! -t 0 ]; then | |
file=/dev/stdin | |
elif [ -f $1 ]; then | |
file=$1 | |
else | |
echo "Usage: $0 code.c" | |
echo "or e.g. head code.c|$0" | |
exit 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
... era incapaz de explicar por que tais pensamentos vinham a seu encontro, no | |
meio da noite, e por que faziam com que se sentisse tão culpado. Agachou-se | |
dentro de seu manto. A realidade não era nem um pouco como o sonho. O Deserto | |
Amistoso, que um dia se estendera de um pólo a outro, estava reduzido à metade | |
de seu tamanho. O paraíso mítico das extensões verdes que se ampliavam o enchia | |
de angústia. | |
Não era como o sonho. Enquanto seu planeta mudava, ele também mudava. | |
Tornara-se uma pessoa mais sutil do que o chefe de sietch que um dia fora. Agora |
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
#!/bin/sh | |
# http://osxdaily.com/2010/05/06/speed-up-a-slow-terminal-by-clearing-log-files/ | |
rm -rf /private/var/log/asl/*.asl |
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
#!/bin/bash | |
# Install Python 2.7.3 alternatively | |
# original script: | |
# https://github.com/bngsudheer/bangadmin/blob/master/linux/centos/6/x86_64/build-python-27.sh | |
# | |
yum groupinstall "development tools" -y | |
yum install -y readline-devel openssl-devel gmp-devel \ | |
ncurses-devel gdbm-devel zlib-devel expat-devel libGL-devel \ | |
tk tix gcc-c++ libX11-devel glibc-devel bzip2 tar tcl-devel \ | |
tk-devel pkgconfig tix-devel bzip2-devel sqlite-devel autoconf \ |
OlderNewer