Skip to content

Instantly share code, notes, and snippets.

View tysonwolker's full-sized avatar

Tyson Wolker tysonwolker

  • Q-CTRL
  • undefined
View GitHub Profile
public [\w?]* (\w+)* .*

Magic words:

psql -U postgres

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

  • \q: Quit/Exit
  • \c __database__: Connect to a database
  • \d __table__: Show table definition including triggers
# Install HomeBrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
# Gems
gems=(
lunchy
compass
cocoapods
)
@tysonwolker
tysonwolker / Vim Cheatsheet
Created July 11, 2015 14:04
Vim Cheatsheet
gg - first line
dG - delete all lines
set nocompatible " Required
filetype off " Required
" --- Vundle ---
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'bling/vim-airline'
Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/nerdtree'
processToKill=$(lsof -n -i4TCP:9999 | grep LISTEN | awk '{print $2}')
if [ -n "$processToKill" ]; then
kill $processToKill
fi
@tysonwolker
tysonwolker / killport.zsh
Last active November 18, 2015 04:10
Kill process by port
zmodload zsh/zutil
zparseopts -A ARGUMENTS -p:
PORT=$ARGUMENTS[--p]
processToKill=$(lsof -n -i4TCP:$PORT | grep LISTEN | awk '{print $2}')
if [ -n "$processToKill" ]; then
kill $processToKill
printf 'Killed port: "%s"\n' "$PORT"
fi
@tysonwolker
tysonwolker / git-cheat-list.md
Created February 20, 2017 23:25
Git cheat list

Git cheat list

  • name of the current banch and nothing else (for automation)

    git rev-parse --abbrev-ref HEAD
    
  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
@tysonwolker
tysonwolker / git-cheat-list.md
Created February 20, 2017 23:25
Git cheat list

Git cheat list

  • name of the current banch and nothing else (for automation)

    git rev-parse --abbrev-ref HEAD
    
  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
@tysonwolker
tysonwolker / custom.json
Last active August 22, 2017 00:45
Video Store
{
"name": "martin",
"rentals": [
{"movieID": "F001", "days": 3},
{"movieID": "F002", "days": 1},
]
}