Skip to content

Instantly share code, notes, and snippets.


Copy current filename to clipboard

:let @+ = expand("%")

Paste last yank


The registry 0 always keep the last yanked text.



  • Rename session: <C-a> $
  • List existing sessions: tmux list-sessions
  • Attach to an existing session: tmux at -t <session name>
View retorno_issintel
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
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 May 30, 2013
Load postgres dump
View new_gist_file
pg_restore --verbose --clean --no-acl --no-owner -d tributario_development latest.dump
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

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 / settle_braintree.rb
Created Mar 22, 2015
Settle braintree transaction via API
View settle_braintree.rb
Braintree::Configuration.instantiate.http.put "/transactions/#{}/settle"