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
# colocar dentro do ~/.bash_profile | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
# rvm |
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
385002 = 38500-200 | |
38500201 = 38500-201 | |
2950 = 00295-000 | |
22923 = 02292-300 | |
125 = 00012-500 |
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
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 |
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
# | |
# Deve completar a máscara de acordo com o número informado | |
# | |
mask("125") | |
=> "00012-500" | |
mask("385002") | |
=> "38500-200" |
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
it "should always update permalink" do | |
model.permalink :title, :always_update => true | |
record = model.create(:title => "Some nice post", :permalink => " ") | |
record.permalink.should == "some-nice-post" | |
record.title = "another title" | |
record.save | |
record.permalink.should == "another-title" |
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
# encoding: utf-8 | |
require "tire" | |
users = [ | |
{ :id => '1', :type => 'user', :name => 'Jesus Lopes', :email => 'jl@zigotto.com' }, | |
{ :id => '2', :type => 'user', :name => 'Alfredo', :email => 'alfredo@email.com' }, | |
{ :id => '3', :type => 'user', :name => 'Éder Costa', :email => 'ec@zigotto.com' } | |
] | |
Tire.index("users") do |
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
$ ruby -v | |
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0] | |
$ rake stats | |
Code LOC: 1969 Test LOC: 3407 Code to Test Ratio: 1:1.7 | |
$ time bundle exec rails runner "puts 'hello'" | |
rails real user sys | |
3.0.11 12.087 7.673 2.236 |
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
$ rake db:create | |
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. | |
at /Users/jtadeulopes/.rvm/gems/ruby-1.8.7-p370@global/gems/rake-0.9.2.2/lib/rake/rdoctask.rb | |
dyld: lazy symbol binding failed: Symbol not found: _mysql_init | |
Referenced from: /Users/jtadeulopes/.rvm/gems/ruby-1.8.7-p370/gems/mysql-2.8.1/lib/mysql_api.bundle | |
Expected in: flat namespace | |
dyld: Symbol not found: _mysql_init | |
Referenced from: /Users/jtadeulopes/.rvm/gems/ruby-1.8.7-p370/gems/mysql-2.8.1/lib/mysql_api.bundle | |
Expected in: flat namespace |
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
#include <stdio.h> | |
#define LIMITE 50 | |
int main(void) | |
{ | |
int A=0, B=0, C=0, soma; | |
printf("Digite um número inteiro: \n"); | |
scanf("%d", &A); |
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
# https://github.com/sstephenson/rbenv | |
# | |
# I'm using rbenv-build to install ruby | |
# https://github.com/sstephenson/ruby-build | |
cd ~/.rbenv/ | |
git pull | |
cd plugins/ruby-build/ | |
git pull | |
rbenv install 2.0.0-p0 |