Skip to content

Instantly share code, notes, and snippets.

View hackling's full-sized avatar

Nicholas Chmielewski hackling

View GitHub Profile
@hackling
hackling / Explanation.md
Last active August 29, 2015 14:09
How to use FIND and SED together

Combining both find and sed to find and replace words

Example script

find app db spec -type f \( -name '*.rb' -o -name '*.sql' \) -exec sed -i '' -e 's/dollar_value/budget_value/g' {} \;

This script:

  • searches in the app, db, and spec directories
  • it only looks at file types that are either .rb or .sql files
@leonelgalan
leonelgalan / README.md
Created November 17, 2014 21:39
Using stackprof and rspec (Rails)
  1. Existing rspec-stackprof is "empty"
  2. stackprof is written as a replacement for perftools.rb
  3. Added an environment variable to conditionally run the profiler, it slows down test runtime by a couple of seconds for me.
  4. Just add stackprof.rb to your spec/support folder, which is loaded on rails_helper.rb