Console Tricks & Shortcuts

Console Tricks & Shortcuts

Ac75ac9b572ec47e912152a9b21f6c69?s=128

Fernando Sainz

February 07, 2017
Tweet

Transcript

  1. 2.
  2. 4.
  3. 6.

    HISTORY hist (history) hist --all (-a) hist -T (--tail) 20

    hist -G (--grep) (REGEX) hist -r (--replay) 14..16 hist -n (--no-numbers) # "hh", "hist -a -T30" # "hn", "hist -a -T30 -n" # "hg", "hist -a -G" # "hr", "hist -a -r" # CTRL + R
  4. 9.

    PBCOPY / PBPASTE foo = '123' `echo #{foo} | pbcopy`

    `echo #{ISO3166::Country.all} | pbcopy` # fails IO.popen('pbcopy', 'w') { |f| f << ISO3166::Country.all } bar = `pbpaste`
  5. 12.
  6. 16.

    INSPEKTOREN - SONDERFÄLLE Pry::Inspector::MAP['default_with_special_cases'] = { description: 'provides extra info

    for some models', value: proc do |output, value, _pry_| case value when User puts "\e[34m #{ value.role } #{ value.email } \e[0m\n -------- \n" end Pry::DEFAULT_PRINT.call(output, value, _pry_) end }
  7. 17.
  8. 21.
  9. 23.

    WARNUNGEN be rails c The meta-request gem can cause a

    SystemStackError: stack level too deep when saving a shop record. See https://github.com/rgeo/activerecord-postgis-adapter/issues/81 Loading development environment (Rails 4.2.6)
  10. 24.
  11. 25.
  12. 26.
  13. 27.
  14. 29.

    DOCS / MODELLE # gem 'pry-doc' ? Array#reduce (alias show-doc)

    show-middleware show-model show-models show-routes
  15. 30.

    binding.pry whereami caller # gem 'pry-byebug' # break, step, next,

    finish, continue # backtrace, up, down, frame
  16. 32.
  17. 33.

    BENACHRICHTIGUNGEN NACH LANGEN PROZESSEN # gem 'terminal-notifier' def ping_when_finished(&block) block.call

    if block_given? `say fertig` `terminal-notifier -message "finished" -sound default -timeout 5` end
  18. 38.

    FIND MY DEV module FindMyDev def fer self.find_by(first_name: "Fernando", last_name:

    "Sainz") end def important_client # .... end end User.extend(FindMyDev) if Rails.env.development?
  19. 42.