This file contains 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
$ find . -name '*erb' | \ | |
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | \ | |
bash | |
from: http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet |
This file contains 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
source: http://www.winksaville.com/blog/linux/git-applying-patches/ | |
Today learned some things about git and applying patches. First when applying my trec/ace/kshmem patches to 2.6.25-rc2 they wouldn’t apply because now there only an x86 architecture (arch/x86) instead of two architectures i386 and x86_64. That was to be expected actually and there’s going to be some hand work in doing that. | |
To do this hand work I really need to see what my current patches look like and there isn’t quite enough context in the patch file to do that, at least for me. So I cloned the current linux-2.6 tree into a new directory linux-2.6-x and did a checkout of 2.6.21-rc6 which is what my patches should apply against. | |
Well almost, there was still some need for a little tweaking; First git am will take my series of patches which were generated using git format-patch and apply them extracting from the email the commit message and the patch. It then creates a commit. But if there is a problem in a series only those that applied cl |
This file contains 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
grep -r --include=*.rb "some_string" some_directory | |
source: http://www.daniweb.com/community-center/threads/85626/limiting-grep-searches-to-a-given-file-type |
This file contains 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
find . -name *.swp -exec rm -f {} \; |
This file contains 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
Command + Option + Esc | |
pra encerrar o aplicativo em primeiro plano Command + Option + | |
Shift + Esc por uns 3 segundos | |
Acento Agudo (´): Option + E | |
C Com Cedilha (Ç): Option + C | |
Til (~): Optin + N | |
Acento Circunflexo (^): Option + I | |
Trema (¨): Option + U |
This file contains 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
# application_controller.rb | |
before_filter :mailer_set_url_options | |
... | |
def mailer_set_url_options | |
ActionMailer::Base.default_url_options[:host] = request.host_with_port | |
end |
This file contains 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
Install ruby after defining cppflags and ldflags pointing to readline | |
$ brew install readline | |
$ export CPPFLAGS=-I/usr/local/Cellar/readline/6.2.2/include | |
$ export LDFLAGS=-L/usr/local/Cellar/readline/6.2.2/lib/ | |
$ rbenv install 1.9.3-rc1 |
This file contains 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
Clone that guy: | |
git clone https://github.com/spox/soap4r-spox.git | |
and install running ruby setup.rb all |
This file contains 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
%a - The abbreviated weekday name (``Sun'') | |
%A - The full weekday name (``Sunday'') | |
%b - The abbreviated month name (``Jan'') | |
%B - The full month name (``January'') | |
%c - The preferred local date and time representation | |
%d - Day of the month (01..31) | |
%H - Hour of the day, 24-hour clock (00..23) | |
%I - Hour of the day, 12-hour clock (01..12) | |
%j - Day of the year (001..366) |
This file contains 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
# Install the gcc compiler 4.2 | |
brew tap homebrew/dupes | |
brew install apple-gcc42 | |
# Install xquartz http://xquartz.macosforge.org/landing/ | |
export CPPFLAGS=-I/opt/X11/include | |
CC=/usr/local/bin/gcc-4.2 rvm reinstall ree --disable-tcl --disable-tk | |
CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7 --disable-tcl --disable-tk |