Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Console Tricks & Shortcuts

Console Tricks & Shortcuts

Ac75ac9b572ec47e912152a9b21f6c69?s=128

Fernando Sainz

February 07, 2017
Tweet

More Decks by Fernando Sainz

Other Decks in Programming

Transcript

  1. ENTWICKLER SHORTCUTS CONSOLE TRICKS

  2. None
  3. ... wie war es nochmal?

  4. VERLAUF

  5. FUZZY FINDER https://github.com/junegunn/fzf

  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
  7. COPY/PASTE

  8. VERKLEINERUNG DER SCHRIFTGRÖSSE

  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`
  10. PRY-CLIPBOARD # gem 'pry-clipboard' Clipboard.copy Array.methods foo = Clipboard.paste #

    "cc", "copy-history -T -2 -l" # input und output
  11. sublime copy-clip

  12. OUTPUT

  13. DARSTELLUNGSMÖGLICHKEITEN puts #foo.to_s p #foo.inspect pp # pretty print j/jj

    # pretty json
  14. TABELLARISCHE DATEN

  15. INSPEKTOREN list-inspectors change-inspector # default, simple, clipped # custom: awesome,

    hirb, special_cases
  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 }
  17. PROMPT

  18. PROMPTS list-prompts change-prompt # simple, nav, none # custom: rails_app,

    memory
  19. UMGEBUNG PROMPT

  20. ARBEITSSPEICHER PROMPT

  21. FARBEN

  22. FARBCODES http://stackoverflow.com/questions/1489183/colorized-ruby-output

  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)
  24. EMOJI!

  25. None
  26. None
  27. DEBUGGING

  28. ERKUNDEN show-source ls cd find-method Foo._tab_autovervollstaendigung edit -p Foo #

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

    show-middleware show-model show-models show-routes
  30. binding.pry whereami caller # gem 'pry-byebug' # break, step, next,

    finish, continue # backtrace, up, down, frame
  31. BETTER ERRORS

  32. WARTEN

  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
  34. TQDM https://github.com/powerpak/tqdm-ruby

  35. KONFIGURATION

  36. .PRYRC isolieren eingebautes Cheatsheet

  37. ABKÜRZUNGEN

  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?
  39. FIND MY DEV User.fer City.bonn Company.haribo # ...

  40. DEV TOOLS LEISTE

  41. DEV TOOLS LEISTE Routes Emails Sidekiq Styles Sprachenschalter Impersonieren /

    Role Switch Zeitreisen
  42. None
  43. 1 CLICK SETUP

  44. DANKE! Fernando Sainz fsainz.com