Skip to content

Instantly share code, notes, and snippets.

View dx7's full-sized avatar

Rafael Almeida de Carvalho dx7

View GitHub Profile
$ script/console
Loading development environment (Rails 2.3.8)
ruby-1.8.7-p299 > country = Country.create :name => "Brasil"
=> #<Country id: 3, name: "Brasil", created_at: "2010-07-23 15:37:58", updated_at: "2010-07-23 15:37:58">
ruby-1.8.7-p299 > state = State.create :name => "RJ"
=> #<State id: 2, name: "RJ", country_id: nil, created_at: "2010-07-23 15:38:15", updated_at: "2010-07-23 15:38:15">
ruby-1.8.7-p299 > country.states << state
=> [#<State id: 2, name: "RJ", country_id: 3, created_at: "2010-07-23 15:38:15", updated_at: "2010-07-23 15:38:28">]
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
/* Syntax Highlighter */
.dp-highlighter
{
font-family: "Menlo", "Monaco", "BitStream Vera Sans Mono", "Consolas", "Courier New", Courier, mono, serif;
font-size: 12px;
background-color: #0A263F;
width: 99%;
overflow: auto;
margin: 18px 0 18px 0 !important;
/* Stylesheet generated from TextMate theme
* Loaded by rafael.xlii.com.br - production mode
*
* Sunburst
* (Ï€) Soryu, 2005
*
*/
/* Mostly to improve view within the TextMate HTML viewer */
body {
@dx7
dx7 / gist:713653
Created November 24, 2010 13:28
.inputrc
# allow you to start typing a command and use the up/down arrow to auto complete from commands in your history
"\e[B": history-search-forward
"\e[A": history-search-backward
# Next thing is to fix an input problem (from iTerm FAQ)
set meta-flag on
set input-meta on
set output-meta on
set convert-meta off
@dx7
dx7 / .vimrc
Created June 3, 2011 01:38
vimrc por rafaeldx7 <rafaeldx7@gmail.com>
" vimrc por rafaeldx7 <rafaeldx7@gmail.com>
" Desliga os barulhos que eu acho muito irritantes
set visualbell t_vb=
" Status line
set laststatus=2
set statusline=
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " filename
@dx7
dx7 / gist:1083894
Created July 15, 2011 02:03 — forked from rodrigotassinari/gist:1078666
Patched Ruby 1.9.2 for faster load and GC
# Just run:
# bash < <(curl -Ls https://raw.github.com/gist/1083894)
# Update and cleanup RVM
rvm get head
rvm reload
rvm cleanup all
# Ruby 1.9 Fast require:
# https://gist.github.com/1008945
@dx7
dx7 / gist:1333785
Created November 2, 2011 14:33
Installing ruby-debug with ruby-1.9.3-p0
### UPDATE: ruby-debuy19 is no longer maintained, use https://github.com/cldwalker/debugger
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1333785)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
VBoxManage createvm --name openbsd --ostype OpenBSD_64
VBoxManage registervm /Users/rafaeldx7/VirtualBox\ VMs/openbsd/openbsd.vbox
VBoxManage createhd --filename /tmp/openbsd.vdi --size 4096
VBoxManage storageattach openbsd --storagectl disk --port 1 --type hdd --medium /tmp/openbsd.vdi
VBoxManage modifyvm openbsd --natpf1 "guestssh,tcp,,2222,,22" # permite conectar ssh
pkg add bash unzip gmake-3.82 qt4-4.7.3p0 ruby-1.9.2.290 libxml-2.7.8p2 libxslt-1.1.26p2 mysql-server-5.1.54p9 gcc-4.2.4p4v0
ln -sf /usr/local/bin/python2.7 /usr/local/bin/python
ln -sf /usr/local/bin/python2.7-2to3 /usr/local/bin/2to3
ln -sf /usr/local/bin/python2.7-config /usr/local/bin/python-config
ln -sf /usr/local/bin/pydoc2.7 /usr/local/bin/pydoc
ln -sf /usr/local/bin/ruby19 /usr/local/bin/ruby