Skip to content

Instantly share code, notes, and snippets.

View fabianoalmeida's full-sized avatar
🎯
Focusing

Fabiano Almeida fabianoalmeida

🎯
Focusing
  • São Paulo, Brazil
View GitHub Profile
@fabianoalmeida
fabianoalmeida / install ubuntu 10.10
Created July 30, 2011 21:58 — forked from vinioliveira/install ubuntu 10.10
Configuring the instalation of nginx+rvm+passenger on Ubuntu 10.10
#Add new user to deploy your application on Ubuntu 10.10
useradd -s /bin/bash -m app-user # add user
passwd app-user # change password
#in /usr/sbin/visudo Add line below just below 'root ALL=(ALL) ALL':
app-user ALL=(ALL) ALL
#change to user early created
su app-user
@fabianoalmeida
fabianoalmeida / cpf_cnpj_validators.rb
Created July 11, 2011 18:02 — forked from gouvermxt/cpf_cnpj_validators.rb
validação de CPF e CNPJ em Ruby
#------------------------------------------------------------------------------
# Rotinas para verificação de CPF e CNPJ
# Linguagem: Ruby
# Escrito por: André Camargo < [email protected] > http://blog.boaideia.inf.br
# Use, copie, melhore a vontade! Patches são bem-vindos...
#------------------------------------------------------------------------------
def check_cpf(cpf=nil)
return false if cpf.nil?
nulos = %w{12345678909 11111111111 22222222222 33333333333 44444444444 55555555555 66666666666 77777777777 88888888888 99999999999 00000000000}
@fabianoalmeida
fabianoalmeida / gist:908620
Created April 7, 2011 20:16
Defining the environment to run db:migrate
rake RAILS_ENV=test db:migrate
rake RAILS_ENV=test db:migrate:reset
@fabianoalmeida
fabianoalmeida / gist:901733
Created April 4, 2011 14:30
Making your application works with Oracle Database
Link: http://oldwiki.rubyonrails.org/rails/pages/Oracle
@fabianoalmeida
fabianoalmeida / gist:901725
Created April 4, 2011 14:27
Configuring a Client Oracle on Ubuntu for Ruby Application
# Prerequisites
sudo apt-get install libaio-dev
# Oracle Instant Client
"Instant Client Basic" and "Instant Client SDK" packages from Oracle’s site - http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
# Jump into /opt/oracle and extract them
# You will then end up with a folder such as instant-client_11_2 (the SDK will end up in the same folder).
@fabianoalmeida
fabianoalmeida / config_swap_vim.sh
Created March 31, 2011 19:32
Configuration No Swap on Vim
echo "set noswapfile
set term=ansi" >> ~/.vimrc