Skip to content

Instantly share code, notes, and snippets.

View MarceloCajueiro's full-sized avatar

Marcelo G. Cajueiro MarceloCajueiro

View GitHub Profile
@MarceloCajueiro
MarceloCajueiro / lista.md
Created November 26, 2015 21:20
Lista Suplementos
@MarceloCajueiro
MarceloCajueiro / heroku_killer.rb
Last active August 29, 2015 14:26
Heroku dyno killer
require 'pty'
require 'active_support'
require 'active_support/core_ext/time'
require 'active_support/core_ext/numeric'
TIMEOUT_TO_KILL_DYNO = 3.minute.from_now
TIMEOUT_TO_ANY_KILL = 30.seconds
MAX_PROBLEMS = 3
PROBLEMS = {
@MarceloCajueiro
MarceloCajueiro / gist:d32b9cb50cfd5777052b
Created May 21, 2015 12:59
Shell functions to use with Rails/Spring
rake() { if [ -f bin/rake ]; then bin/rake "$@"; else bundle exec rake "$@"; fi }
rails() { if [ -f bin/rails ]; then bin/rails "$@"; else bundle exec rails "$@"; fi }
rspec() { if [ -f bin/rspec ]; then bin/rspec "$@"; else bundle exec rspec "$@"; fi }
@MarceloCajueiro
MarceloCajueiro / gist:7254544
Created October 31, 2013 18:28
Delete jobs from sidekiq
queue = Sidekiq::Queue.new("low")
queue.each do |job|
if job.klass == "MailChimpUpdate"
job.delete
end
end
@MarceloCajueiro
MarceloCajueiro / f.rb
Created August 20, 2013 19:13 — forked from bricker/f.rb
def json
if self.persisted?
original_bylines_json = self.class.find(self.id).bylines.as_json
else
original_bylines_json = [].as_json
end
end
# ---------------
@media all {
.page-break {
display: none;
}
}
@media print {
.page-break {
display: block;
page-break-before: always;
class PeopleController < CrudController
respond_to :js
def new
object = build_resource
object.personable = Individual.new
super
end
@MarceloCajueiro
MarceloCajueiro / gist:5014692
Last active December 14, 2015 02:38
Simple way to print commit url
gh_commit(){
echo "https://github.com/$1/$2/commit/$3"
}
nohup_commit(){
gh_commit "nohupbrasil" $*
}
contabil_commit(){
nohup_commit "contabilidade" $*

Caminhos Para Vida Sustentável

em 4 módulos

março a maio de 2013

Instituto Arca Verde

São Francisco de Paula - RS

@MarceloCajueiro
MarceloCajueiro / gist:4944334
Last active September 30, 2018 18:18
git work flow

Atualizando o branch de trabalho

Supondo que se está no branch de trabalho chamado work

git checkout master

git pull origin master

git checkout work