Skip to content

Instantly share code, notes, and snippets.

cat ~/.gitconfig
[user]
name = José Gomes Júnior
email = [email protected]
[core]
excludesfile = ~/.gitignore
[color]
diff = auto
status = auto
branch = auto

Atualizando o branch de trabalho

Supondo que se está no branch de trabalho chamado work

git checkout master

git pull origin master

git checkout work

require "#{Rails.root}/lib/development_mail_interceptor"
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:user_name => 'zegomesjf',
:password => 'euamoocomogo',
:authentication => 'plain',
:enable_starttls_auto => true
}
@zegomesjf
zegomesjf / gist:3425179
Created August 22, 2012 12:37
Object#presence

object.presence is equivalent to object.present? ? object : nil

Use

region = params[:state].presence || params[:country].presence || 'US'

instead

@zegomesjf
zegomesjf / remove_dups.rb
Created June 18, 2012 16:18 — forked from urubatan/remove_dups.rb
Ruby script to remove duplicated files, I created it when migrating my pictures collection from iPhoto to picasa, and merged some independent collections, it created a real mess, and the result of this big mess is this gist.
require 'digest/sha1'
require 'fileutils'
directories = [
"SOURCE DIR 1",
"SOURCE DIR 2"
]
files = {}
directories.each do |dir_name|
puts "Scanning Directory: #{dir_name} "
Dir.glob("#{dir_name}/**/*.*") do |file_name|
@zegomesjf
zegomesjf / .tmux.conf
Created May 9, 2012 17:31
configuração do tmux
set -g default-terminal "screen-256color"
set -g mode-mouse on
require 'validate_entry_state'
describe Entry_State do
it "should be invalid without a number" do
entry_state = Entry_State.new(nil, "PR")
entry_state.should_not be_valid
end
it "should be invalid without a state" do
entry_state = Entry_State.new("123456789", nil)