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 / config_swap_vim.sh
Created March 31, 2011 19:32
Configuration No Swap on Vim
echo "set noswapfile
set term=ansi" >> ~/.vimrc
@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 / 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: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 / 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 / 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 / gist:1116156
Created July 30, 2011 23:33
Installing PostgreSQL on Ubuntu for Rails - gem install pg
# Before it's necessary install a lib
sudo apt-get install libpq-dev
# And then
gem install pg
More: http://i.justrealized.com/2010/install-pg-gem-postgresql-ubuntu/
@fabianoalmeida
fabianoalmeida / gist:1126084
Created August 4, 2011 19:59
Install MySQL on Ubuntu and setting external access
# Install MySQL
sudo apt-get install mysql-server
# After set the root password
# Configure the file:
sudo vi /etc/mysql/my.conf
# And add this configuration to bind-address attribute (under [mysqld])
bind-address = 0.0.0.0
@fabianoalmeida
fabianoalmeida / installing_oracle_unix
Created August 29, 2011 14:31
Installing a gem whose need the environment - Oracle
# Linux
env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ARCHFLAGS="-arch i386" gem install ruby-oci8
# Mac
env DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH ARCHFLAGS="-arch x86_64" gem install ruby-oci8
@fabianoalmeida
fabianoalmeida / gist:1293103
Created October 17, 2011 17:05
Gems used in Captie project
Gems included by the bundle:
* ZenTest (4.5.0)
* actionmailer (3.1.0)
* actionpack (3.1.0)
* activemodel (3.1.0)
* activerecord (3.1.0)
* activeresource (3.1.0)
* activesupport (3.1.0)
* ansi (1.3.0)
* archive-tar-minitar (0.5.2)