Skip to content

Instantly share code, notes, and snippets.

View MarceloCajueiro's full-sized avatar

Marcelo G. Cajueiro MarceloCajueiro

View GitHub Profile
en:
errors:
messages:
not_found: "Não encontrado"
already_confirmed: "Já foi confirmado"
not_locked: "Não foi bloequeado"
devise:
failure:
unauthenticated: 'Para continuar, faça o login ou registrar-se.'
@MarceloCajueiro
MarceloCajueiro / devise.pt-BR.yml
Created June 7, 2011 17:43 — forked from mateusg/devise.pt-BR.yml
pt-BR translations for Devise
# encoding: UTF-8
# pt-BR translations for Devise
pt_br:
errors:
messages:
expired: "expirou, por favor, solicite uma nova"
not_found: "não encontrado"
already_confirmed: "já foi confirmado, tente entrar por favor"
not_locked: "não foi bloqueado"
not_saved:
@MarceloCajueiro
MarceloCajueiro / warden.rb
Created August 11, 2011 22:30 — forked from cavalle/warden.rb
Testing Warden/Devise with Steak
# Create a file `spec/acceptance/support/warden.rb' with the following
# contents:
Spec::Runner.configure do |config|
config.include Warden::Test::Helpers, :type => :acceptance
config.after(:each, :type => :acceptance) { Warden.test_reset! }
end
# Or, if you're using RSpec 2 / Rails 3, the contents should be the following
# instead:
@MarceloCajueiro
MarceloCajueiro / range_parser.rb
Created October 5, 2011 16:55 — forked from tomas-stefano/range_parser.rb
Range Parser. Transform a string in an Array of values
module Tributario
class RangeParser
attr_reader :range_string
def initialize(word)
@range_string = word
end
# Parse the string and return an array of numbers
#
@MarceloCajueiro
MarceloCajueiro / post_test.rb
Created October 21, 2011 21:29 — forked from wojtekmach/post_test.rb
minitest + shoulda-matchers
gem "minitest"
require "minitest/spec"
require "minitest/autorun"
require "active_model"
require "turn"
require "shoulda-matchers"
class MiniTest::Unit::TestCase
include Shoulda::Matchers::ActiveModel
extend Shoulda::Matchers::ActiveModel
# Load plugins (only those I whitelist)
Pry.config.should_load_plugins = false
Pry.plugins["doc"].activate!
# Launch Pry with access to the entire Rails stack.
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead.
# If you don't, you can load it through the lines below :)
rails = File.join Dir.getwd, 'config', 'environment.rb'
if File.exist?(rails) && ENV['SKIP_RAILS'].nil?

Com ou sem experiência, todo desenvolvedor sabe que o software IRÁ ser alterado em algum momento e é nessa hora que diversos problemas ocorrem.

O SOLID é um conjunto de princípios que ajudam para que essas modificações sejam menos traumáticas possíveis através de um código conciso, desacoplado e bem arquitetado.

Na palestra iremos falar sobre todos os princípios do acrônimo SOLID explicando-os e exemplificando com código Ruby.

@MarceloCajueiro
MarceloCajueiro / a_violacao.rb
Created November 29, 2012 18:28
Violação de Demeter
class A
def do_things(b)
b.c.do_things #violação de demeter
end
end
class B
attr_reader c
end

Caminhos Para Vida Sustentável

em 4 módulos

março a maio de 2013

Instituto Arca Verde

São Francisco de Paula - RS

class PeopleController < CrudController
respond_to :js
def new
object = build_resource
object.personable = Individual.new
super
end