Skip to content

Instantly share code, notes, and snippets.

@jch
Last active December 13, 2015 18:48
Show Gist options
  • Save jch/4957452 to your computer and use it in GitHub Desktop.
Save jch/4957452 to your computer and use it in GitHub Desktop.

Collection of Everyday Tips

Also see The Lazy Programmer

Mac

  • cmd-shift-t open last tab (sometimes preserves input) via @atmos
  • option-shift-volume|brightness increase/decrease brightness or volume by quarter increments
  • cmd-shift-3 whole screenshot
  • cmd-shift-4 select screenshot. Click space and it'll let you choose a window.
  • cmd-shift-g in finder, go to folder. tab completion available
  • cmd-shift-h go to home
  • cloudapp, skitch

Shell

  • cd - go back to last directory
  • cd ~ go to home dir
  • control-a, control-e - beginning and end of line
  • option-b, option-f - backward/forward one word
  • control-k - kill line
  • pbcopy - takes input and puts it into osx clipboard
  • pbpaste - pastes clipboard
  • !! - run last command
  • control-r - search through recent commands
  • lsof -i:3000 - list processes running on port 3000
  • alias all the things
  • grep, ack
  • wc
  • sort -n
  • du

Ruby

  • bundle open gem-name opens the version of the gem in your editor
  • gem unpack gem-name quick way to vendor a gem
  • ruby -pe; perl -pe; python -pe

Git

  • git config
    • alias
  • hub
    • git pull request
    • git clone
    • git fork
    • git browse

Curl

  • basic usage
  • -I show just headers
  • -H send headers
  • -d form post

Files

  • cat > filename; control-d
  • touch
  • sed -i

Dotfiles

  • sourcing a local overrides

Web

  • dotjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment