Skip to content

Instantly share code, notes, and snippets.

View sandrocarval's full-sized avatar

Sandro Ribeiro sandrocarval

  • Brazil
  • 19:37 (UTC -03:00)
View GitHub Profile
@sandrocarval
sandrocarval / commits_for_release_notes.sh
Last active September 6, 2016 16:26
Script that lists the commit messages that were commited in a new branch, and also displays the Phabricator revision number from each commit
#!/bin/bash
while [[ $# > 1 ]]
do
key="$1"
case $key in
-f|--from)
FROM="$2"
shift
@sandrocarval
sandrocarval / brazilian_states.rb
Created March 11, 2015 16:25
Brazilian states / Estados brasileiros
BRAZILIAN_STATES = {
'AC' => 'Acre',
'AL' => 'Alagoas',
'AP' => 'Amapá',
'AM' => 'Amazonas',
'BA' => 'Bahia',
'CE' => 'Ceará',
'DF' => 'Distrito Federal',
'ES' => 'Espírito Santo',
'GO' => 'Goiás',
# CPF and CNPJ validators Rails 3+ style
# By Arthur Corenzan <[email protected]>
# Based on the work of André Camargo <[email protected]>
#
# Copy this file to your initializers or lib directory, then apply like this:
#
# class Person
# ...
#
# validates :cpf, :cpf => true