Skip to content

Instantly share code, notes, and snippets.

View gouvermxt's full-sized avatar
:electron:

Marcio Gouvea Silva gouvermxt

:electron:
View GitHub Profile
$(function($) {
init_clock();
setInterval(function() {
update_clock();
}, 1000);
//Inits the clock with date from server
function init_clock() {
@gouvermxt
gouvermxt / cpf_cnpj_validators.rb
Created June 3, 2011 00:39
validação de CPF e CNPJ em Ruby
#------------------------------------------------------------------------------
# Rotinas para verificação de CPF e CNPJ
# Linguagem: Ruby
# Escrito por: André Camargo < andre@boaideia.inf.br > 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}
class Notifier < ActionMailer::Base
#emails omitidos propositalemnte para este gist
default :from => "xxx@xxxxx", :to => "xxx@xxxxx",
:subject => I18n.t("notifier.contact_message.subject")
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.notifier.contact_message.subject
class ObjectGroup < ActiveRecord::Base
has_and_belongs_to_many :users
has_and_belongs_to_many :object_items
strip_attributes!
validates :description, :presence => true, :uniqueness => true, :allow_blank => true
#Search
@gouvermxt
gouvermxt / default.rb
Created February 24, 2011 19:43
default app template
if yes?("Use mysql?")
gem("mysql2")
end