Skip to content

Instantly share code, notes, and snippets.

View MarceloCajueiro's full-sized avatar

Marcelo G. Cajueiro MarceloCajueiro

View GitHub Profile

Fooo bar

Valor inicial Valor anulado Valor liquidado Valor atual
500,00 200,00 100,00 100,00

foo

# 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?
@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
@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 / gist:1168710
Created August 24, 2011 18:02
To change the color of code comments in github
// Run the follow code as a URL;
// Create a shortcut for your convenience.
javascript:(function(){$('.highlight%20.c1').css('color',%20'#000');})();
@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 / gist:1114348
Created July 29, 2011 17:54
Vaga para Web developer

Ajude a revolucionar o futuro da publicidade online

A Ocapi está com uma vaga de desenvolvedor Rails júnior para trabalhar remotamente.

É necessário ter experiência com programação e desenvolvimento web MVC, mas não é requisito domínio do Rails.

Desejável:

  • Ruby/Rails 3
  • Javascript
@MarceloCajueiro
MarceloCajueiro / gist:1097165
Created July 21, 2011 13:22
SelectorGadget
javascript:(function(){var%20s=document.createElement('div');s.innerHTML='Loading...';s.style.color='black';s.style.padding='20px';s.style.position='fixed';s.style.zIndex='9999';s.style.fontSize='3.0em';s.style.border='2px%20solid%20black';s.style.right='40px';s.style.top='40px';s.setAttribute('class','selector_gadget_loading');s.style.background='white';document.body.appendChild(s);s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('src','http://www.selectorgadget.com/stable/lib/selectorgadget.js?raw=true');document.body.appendChild(s);})();
@MarceloCajueiro
MarceloCajueiro / crontab -e
Created July 15, 2011 22:00
Cron with RVM to run a rake task
0 0 * * * cd /data/project/; bash -c 'source /usr/local/rvm/bin/rvm && rake -s task' > /tmp/task.log 2>&1