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

Console Tricks & Shortcuts

Console Tricks & Shortcuts

Fernando Sainz

February 07, 2017
Tweet

More Decks by Fernando Sainz

Other Decks in Programming

Transcript

  1. 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
  2. PBCOPY / PBPASTE foo = '123' `echo #{foo} | pbcopy`

    `echo #{ISO3166::Country.all} | pbcopy` # fails IO.popen('pbcopy', 'w') { |f| f << ISO3166::Country.all } bar = `pbpaste`
  3. 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 }
  4. 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)
  5. DOCS / MODELLE # gem 'pry-doc' ? Array#reduce (alias show-doc)

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

    finish, continue # backtrace, up, down, frame
  7. 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
  8. 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?