Skip to content

Instantly share code, notes, and snippets.

View sdemjanenko's full-sized avatar

Stephen Demjanenko sdemjanenko

View GitHub Profile
set chrome to "\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\""
do shell script chrome & " --profile-directory=\"Profile 1\"" & " > /dev/null 2>&1 &"
if filereadable(expand('~/.vimrc.plugs'))
source ~/.vimrc.plugs
endif
if filereadable(expand('~/.vimrc.general'))
source ~/.vimrc.general
endif
Installing PG on mac
https://launchschool.com/blog/how-to-install-postgresql-on-a-mac
https://brew.sh/
Sql.js
https://kripken.github.io/sql.js/examples/GUI/index.html
Common SQL syntax
https://tutorialzine.com/2016/01/learn-sql-in-20-minutes
https://hgducharme.gitbooks.io/sql-basics/content/
" vim-fugitive
nnoremap <leader>gb :Gblame<CR>
" command-t
let g:CommandTWildIgnore=&wildignore . ",*/bower_components,*/node_modules,*/log,*/tmp,*/vendor/bundle"
let g:CommandTFileScanner="git"
let g:CommandTInputDebounce=100
" vim-jsx
let g:jsx_ext_required = 0
" ================ General Config ====================
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "Disable cursor blink
set visualbell "No sounds
set autoread "Reload files changed outside vim
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-fugitive'
Plug 'bogado/file-line'
Plug 'wincent/command-t'
Plug 'lifepillar/vim-solarized8'
Plug 'kshenoy/vim-signature'
Plug 'leafgarland/typescript-vim'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
@sdemjanenko
sdemjanenko / .bash_functions
Created November 25, 2019 22:01
Bash functions
gv() {
if [ $1 ]; then
vim $(git show $1 --pretty=format: --name-only -n 1)
else
vim $(git status --porcelain | sed -ne 's/^ M //p')
fi
}
@sdemjanenko
sdemjanenko / .bash_aliases
Last active November 25, 2019 22:04
Bash aliases
alias gd='git diff'
alias gdc='git diff --cached'
alias gl='git log --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit'
alias gls='git log --stat'
alias gg='git grep -n'
alias gc='git commit'
alias gs='git status'
alias gb="git for-each-ref --sort=committerdate refs/heads/ --format='%(refname:short)'"
alias gri='git rebase -i '
@sdemjanenko
sdemjanenko / .bash_ssh_auth_sock
Created November 25, 2019 21:54
WSL Ubuntu SSH agent socket
export SSH_AUTH_SOCK=~/.ssh/ssh-agent.$HOSTNAME.sock
agent_count=`ps -C ssh-agent --no-headers | wc -l`;
if [ "$agent_count" = 0 ]; then
rm -f $SSH_AUTH_SOCK
fi
ssh-add -l 2>/dev/null >/dev/null
if [ $? -ge 2 ]; then
ssh-agent -a "$SSH_AUTH_SOCK" >/dev/null
fi
// maps extend across many objects
_.mapExtend = function(array) {
var sources = slice.call(arguments, 1);
sources.unshift({});
var source = _.extend.apply(this, sources); // combine sources
each(array, function(obj) {
for (var prop in source) {
obj[prop] = source[prop];
}
});