Skip to content

Instantly share code, notes, and snippets.

@claritee
Last active February 7, 2018 06:05
Show Gist options
  • Save claritee/17a54ae639e03fe5ab9d1188d0bc444b to your computer and use it in GitHub Desktop.
Save claritee/17a54ae639e03fe5ab9d1188d0bc444b to your computer and use it in GitHub Desktop.
Random Setup And Shortcuts

Random notes on setup / shortcuts

Install Homebrew

https://brew.sh/

stree shortcut

ln -s /Applications/SourceTree.app/Contents/Resources/stree /usr/local/bin/

unix tree command

brew install tree
tree dir

Git Completion

https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion bobthecow/git-flow-completion#46

  1. Install
brew install bash-completion
curl -o ~/.git-prompt.sh \
    https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
source ~/.git-prompt.sh
  1. Add to ~/.bash_profile
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
  . `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi

# or source /usr/local/etc/bash_completion.d/git-completion.bash

For colours


GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true

source ~/.git-prompt.sh

RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
GRAY="\[\033[1;30m\]"
LIGHT_GRAY="\[\033[0;37m\]"
CYAN="\[\033[0;36m\]"
LIGHT_CYAN="\[\033[1;36m\]"
NO_COLOUR="\[\033[0m\]"
magenta='\e[0;35m\]'
MAGENTA='\e[1;35m\]'

export PS1='\[\e[1;37m\]\[\e[1;32m\]\u\[\e[0;39m\]:\[\e[1;33m\]\w\[\e[0;39m\]\[\e[1;35m\]$(__git_ps1 " (%s)")\[\e[0;39m\] \[\e[1;37m\]|\[\e[0;39m\]\$'

Sublime

Installation https://packagecontrol.io/installation

Shortcut

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Show console ctrl `

Install a package

ctrl shift p
> Package Control
> package-name

Home directory in sidebar

1. Press CMD+SHIFT+H to enter your Home folder in Finder
2. Then press CMD+ArrowUp to get into the Users folder
3. Drag the folder of your choice to the Sidebar

SSH Keys

In ~/.ssh/config

Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/key_rsa

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

Heroku

Instructions: https://devcenter.heroku.com/articles/heroku-cli#download-and-install

  1. brew install heroku/brew/heroku
  2. Download from https://devcenter.heroku.com/articles/heroku-cli#download-and-install - https://cli-assets.heroku.com/heroku-cli/channels/stable/heroku-cli.pkg

MySQL

mysql -h localhost -u username -p db

Mergetool

[merge]
    tool = diffmerge
[mergetool "diffmerge"]
    path = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge
    trustExitCode = false
[diff]
    guitool = diffmerge
[difftool "diffmerge"]
    path = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge
    trustExitCode = false

Graphviz / Graphlviz

Install:

Option1: Download

https://graphviz.gitlab.io/download

Option2: NPM

https://github.com/sheerun/graphqlviz

Option3: Homebrew

brew install graphviz

Then symlink to dot if you don't have it

E.g.

ln -s /usr/local/Cellar/graphviz/2.40.1/bin/dot /usr/local/bin/dot

Usage:

graphqlviz https://endpoint | dot -Tpng -o graph.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment