Skip to content

Instantly share code, notes, and snippets.

@dotsara
Last active April 12, 2018 15:50
Show Gist options
  • Save dotsara/70c7c52d2a9ec551eb981c98ec291694 to your computer and use it in GitHub Desktop.
Save dotsara/70c7c52d2a9ec551eb981c98ec291694 to your computer and use it in GitHub Desktop.
Stuff that tends to be muscle memory while I'm at a job/on a project, but then I forget when contexts switch.

interrogating tests

Rails environment, using rspec: spit out objects and things to the console with puts

it 'checking a thing' do
puts activity # where activity is the name of an object
puts activity.class
# etc
end

under rbenv

  • Rails console: bundle exec rails c

searching for code

git log -S 'managed_overview_counts' -p

  • -p gives you the diff in Terminal (for easier copy/pasting if you need it)

Ack! I can't believe I forgot about ack.

git-things

git log --name-only --pretty=format: commit1..commit2

Terminal things

  • Give me the last # lines of a file (i.e. a log)

    tail -n 100 log/development.log
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment