Skip to content

Instantly share code, notes, and snippets.

  • Minimize real dollar impact to donors by voiding on braintree before settlement
  • Correct totals online - I made a script for this. Might be safer to run the query first and see what it returns before voiding.
recurring_transfers = RecurringAccountTransfer.due.pluck(:id)

Transaction.where(recurring_account_transfer_id: recurring_transfers).each do |transaction|
dreoliv / settle_braintree.rb
Created Mar 22, 2015
Settle braintree transaction via API
View settle_braintree.rb
Braintree::Configuration.instantiate.http.put "/transactions/#{}/settle"
View clojure_notes.clj
(+ 1 2)
; used to map values in hashes
(def person {:name "Andre"
:city "Florianopolis"})
; Keywords are functions that look themselves up in collections passed to them.
dreoliv / gist:3048530
Created Jul 4, 2012
Indirect object creation
View gist:3048530

Inject factory method

Use for spawning multiple objects

class Foo

  attr_writer :bar_source

dreoliv / new_gist_file
Created May 30, 2013
Load postgres dump
View new_gist_file
pg_restore --verbose --clean --no-acl --no-owner -d tributario_development latest.dump
dreoliv / new_gist_file
Created May 30, 2013
Delete all local branches except master
View new_gist_file
git branch -D `git branch | awk '{ if ($0 !~ /master/) printf "%s", $0 }'`
dreoliv / new_gist_file
Created Jul 29, 2013
Semaphore commands
View new_gist_file
export RUBY_GC_MALLOC_LIMIT=1000000000 && export RUBY_FREE_MIN=500000 && export RUBY_HEAP_MIN_SLOTS=40000
View retorno_issintel


  • Rename session: <C-a> $
  • List existing sessions: tmux list-sessions
  • Attach to an existing session: tmux at -t <session name>

Copy current filename to clipboard

:let @+ = expand("%")

Paste last yank


The registry 0 always keep the last yanked text.