diff --git a/.bash_it/.ackrc b/.bash_it/.ackrc new file mode 100644 index 0000000..876f131 --- /dev/null +++ b/.bash_it/.ackrc @@ -0,0 +1 @@ +--ignore-dir=enabled/ diff --git a/.bash_it/.editorconfig b/.bash_it/.editorconfig new file mode 100755 index 0000000..e35a1b0 --- /dev/null +++ b/.bash_it/.editorconfig @@ -0,0 +1,30 @@ +# EditorConfig is awesome: http://EditorConfig.org + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 + +trim_trailing_whitespace = true +insert_final_newline = true + +[**.{md,rst}] +trim_trailing_whitespace = false + +[.git*] +indent_style = tab + +[{**.*sh,test/run}] +indent_style = tab +indent_size = 4 + +shell_variant = bash +binary_next_line = true # like -bn +switch_case_indent = true # like -ci +space_redirects = true # like -sr +keep_padding = false # like -kp +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.bash_it/.pre-commit-config.yaml b/.bash_it/.pre-commit-config.yaml new file mode 100644 index 0000000..af5f30a --- /dev/null +++ b/.bash_it/.pre-commit-config.yaml @@ -0,0 +1,50 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +--- +# fail_fast: true +minimum_pre_commit_version: 1.18.1 +exclude: "docs/_build/" +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: trailing-whitespace + exclude: ".(md|rst)$" + - id: end-of-file-fixer + - id: check-merge-conflict + - id: mixed-line-ending + - id: check-added-large-files + - repo: https://github.com/jumanjihouse/pre-commit-hooks + rev: 2.1.5 + hooks: + - id: git-check # Configure in .gitattributes + - id: shellcheck + exclude: ".bats$" + - id: shfmt + exclude: ".bats$" + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.1.7 + hooks: + # - id: forbid-crlf + - id: remove-crlf + exclude: ".bat$" + - repo: local + hooks: + - id: dot-sh + name: Check .sh files against bash-it requirements + entry: ./hooks/dot-sh.sh + language: system + files: "\\.sh$" + types: [file] + - id: dot-bash + name: Check .bash files against bash-it requirements + exclude: "test/test_helper.bash" + entry: ./hooks/dot-bash.sh + language: system + files: "\\.bash$" + types: [file] + - id: clean-files-txt + name: Check that clean_files.txt is sorted alphabetically. + entry: ./hooks/check-clean-files-txt.sh + language: system + files: clean_files.txt diff --git a/.bash_it/.readthedocs.yml b/.bash_it/.readthedocs.yml new file mode 100644 index 0000000..751f317 --- /dev/null +++ b/.bash_it/.readthedocs.yml @@ -0,0 +1,10 @@ +version: 2 + +sphinx: + builder: htmldir + configuration: docs/conf.py + +python: + version: 3.7 + install: + - requirements: docs/requirements.txt diff --git a/.bash_it/.shellcheckrc b/.bash_it/.shellcheckrc new file mode 100644 index 0000000..6418bd8 --- /dev/null +++ b/.bash_it/.shellcheckrc @@ -0,0 +1,6 @@ +# We use colors and not assigned +disable=SC2154 +# Hard to fix +disable=SC2155 +# shellcheck is wrong on some +disable=SC2034 diff --git a/.bash_it/LICENSE b/.bash_it/LICENSE new file mode 100644 index 0000000..25b6d7f --- /dev/null +++ b/.bash_it/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2021 Bash-it + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.bash_it/aliases/available/ag.aliases.bash b/.bash_it/aliases/available/ag.aliases.bash new file mode 100644 index 0000000..e3157f9 --- /dev/null +++ b/.bash_it/aliases/available/ag.aliases.bash @@ -0,0 +1,12 @@ +cite 'about-alias' +about-alias 'the silver searcher (ag) aliases' + +## Summary for args to less: +# less(1) +# -M (-M or --LONG-PROMPT) Prompt very verbosely +# -I (-I or --IGNORE-CASE) Searches with '/' ignore case +# -R (-R or --RAW-CONTROL-CHARS) For handling ANSI colors +# -F (-F or --quit-if-one-screen) Auto exit if <1 screen +# -X (-X or --no-init) Disable termcap init & deinit + +alias ag='ag --smart-case --pager="less -MIRFX"' diff --git a/.bash_it/aliases/available/ansible.aliases.bash b/.bash_it/aliases/available/ansible.aliases.bash new file mode 100644 index 0000000..1c53a88 --- /dev/null +++ b/.bash_it/aliases/available/ansible.aliases.bash @@ -0,0 +1,5 @@ +cite 'about-alias' +about-alias 'ansible abbreviations' + +alias ans=ansible +alias ap=ansible-playbook diff --git a/.bash_it/aliases/available/apt.aliases.bash b/.bash_it/aliases/available/apt.aliases.bash new file mode 100644 index 0000000..2f44493 --- /dev/null +++ b/.bash_it/aliases/available/apt.aliases.bash @@ -0,0 +1,28 @@ +#!/bin/bash +# +# -binaryanomaly + +cite 'about-alias' +about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.' + +# set apt aliases +function _set_pkg_aliases() +{ + if [ -x $(which apt) ]; then + alias apts='apt-cache search' + alias aptshow='apt-cache show' + alias aptinst='sudo apt-get install -V' + alias aptupd='sudo apt-get update' + alias aptupg='sudo apt-get dist-upgrade -V && sudo apt-get autoremove' + alias aptupgd='sudo apt-get update && sudo apt-get dist-upgrade -V && sudo apt-get autoremove' + alias aptrm='sudo apt-get remove' + alias aptpurge='sudo apt-get remove --purge' + + alias chkup='/usr/lib/update-notifier/apt-check -p --human-readable' + alias chkboot='cat /var/run/reboot-required' + + alias pkgfiles='dpkg --listfiles' + fi +} + +_set_pkg_aliases diff --git a/.bash_it/aliases/available/atom.aliases.bash b/.bash_it/aliases/available/atom.aliases.bash new file mode 100644 index 0000000..8d70cff --- /dev/null +++ b/.bash_it/aliases/available/atom.aliases.bash @@ -0,0 +1,7 @@ +cite 'about-alias' +about-alias 'Atom.io editor abbreviations' + +alias a='atom' +alias ah='atom .' +alias apmup='apm update --no-confirm' +alias apmi='apm install' diff --git a/.bash_it/aliases/available/bash-it.aliases.bash b/.bash_it/aliases/available/bash-it.aliases.bash new file mode 100644 index 0000000..d297566 --- /dev/null +++ b/.bash_it/aliases/available/bash-it.aliases.bash @@ -0,0 +1,23 @@ +cite about-alias +about-alias 'Aliases for the bash-it command (these aliases are automatically included with the "general" aliases)' + +# Common misspellings of bash-it +alias shit='bash-it' +alias batshit='bash-it' +alias bashit='bash-it' +alias batbsh='bash-it' +alias babsh='bash-it' +alias bash_it='bash-it' +alias bash_ti='bash-it' + +# Additional bash-it aliases for help/show +alias bshsa='bash-it show aliases' +alias bshsc='bash-it show completions' +alias bshsp='bash-it show plugins' +alias bshha='bash-it help aliases' +alias bshhc='bash-it help completions' +alias bshhp='bash-it help plugins' +alias bshsch="bash-it search" +alias bshenp="bash-it enable plugin" +alias bshena="bash-it enable alias" +alias bshenc="bash-it enable completion" diff --git a/.bash_it/aliases/available/bolt.aliases.bash b/.bash_it/aliases/available/bolt.aliases.bash new file mode 100644 index 0000000..8490f71 --- /dev/null +++ b/.bash_it/aliases/available/bolt.aliases.bash @@ -0,0 +1,8 @@ +cite 'about-alias' +about-alias 'puppet bolt aliases' + +# Aliases +alias bolt='bolt command run --tty --no-host-key-check' +alias boltas='bolt -p -u' +alias sudobolt='bolt --run-as root --sudo-password' +alias sudoboltas='sudobolt -p -u' diff --git a/.bash_it/aliases/available/bundler.aliases.bash b/.bash_it/aliases/available/bundler.aliases.bash new file mode 100644 index 0000000..fc20f4f --- /dev/null +++ b/.bash_it/aliases/available/bundler.aliases.bash @@ -0,0 +1,9 @@ +cite 'about-alias' +about-alias 'ruby bundler' + +# Bundler Commands +alias be='bundle exec' +alias bi='bundle install' +alias bl='bundle list' +alias bu='bundle update' +alias bp='bundle package' diff --git a/.bash_it/aliases/available/clipboard.aliases.bash b/.bash_it/aliases/available/clipboard.aliases.bash new file mode 100644 index 0000000..4c7e6f5 --- /dev/null +++ b/.bash_it/aliases/available/clipboard.aliases.bash @@ -0,0 +1,17 @@ +# shellcheck shell=bash +cite 'about-alias' +about-alias 'xclip shortcuts' + +alias pbcopy="xclip -selection clipboard" +alias pbpaste="xclip -selection clipboard -o" + +alias xcpy="xclip -selection clipboard" +alias xpst="xclip -selection clipboard -o" +# to use it just install xclip on your distribution and it would work like: +# $ echo "hello" | xcpy +# $ xpst +# hello + +# very useful for things like: +# cat ~/.ssh/id_rsa.pub | xcpy +# have fun! diff --git a/.bash_it/aliases/available/composer.aliases.bash b/.bash_it/aliases/available/composer.aliases.bash new file mode 100644 index 0000000..5ccb2e2 --- /dev/null +++ b/.bash_it/aliases/available/composer.aliases.bash @@ -0,0 +1,39 @@ +cite 'about-alias' +about-alias 'common composer abbreviations' + +# Aliases +alias coab='composer about' +alias coar='composer archive' +alias cob='composer browser' +alias cocpr='composer check-platform-reqs' +alias cocc='composer clear-cache' +alias cocfg='composer config' +alias cocp='composer create-project' +alias codp='composer depends' +alias codiag='composer diagnose' +alias codmp='composer dump-autoload' +alias coex='composer exec' +alias coglob='composer global' +alias coh='composer help' +alias cohome='composer home' +alias coi='composer install' +alias coinf='composer info' +alias coini='composer init' +alias coli='composer license' +alias colis='composer list' +alias coout='composer outdated' +alias cop='composer prohibits' +alias corem='composer remove' +alias coreq='composer require' +alias coreqd='composer require --dev' +alias cors='composer run-script' +alias cos='composer search' +alias cosu='composer self-update' +alias coshow='composer show' +alias costat='composer status' +alias cosugg='composer suggest' +alias coup='composer update' +alias coupg='composer upgrade' +alias coval='composer validate' +alias cowhy='composer why' +alias cowhyn='composer why-not' diff --git a/.bash_it/aliases/available/curl.aliases.bash b/.bash_it/aliases/available/curl.aliases.bash new file mode 100644 index 0000000..3ced1bb --- /dev/null +++ b/.bash_it/aliases/available/curl.aliases.bash @@ -0,0 +1,25 @@ +#!/bin/bash + +cite 'about-alias' +about-alias 'Curl aliases for convenience.' + +# set apt aliases +function _set_pkg_aliases() +{ + if [ -x $(which curl) ]; then + # follow redirects + alias cl='curl -L' + # follow redirects, download as original name + alias clo='curl -L -O' + # follow redirects, download as original name, continue + alias cloc='curl -L -C - -O' + # follow redirects, download as original name, continue, retry 5 times + alias clocr='curl -L -C - -O --retry 5' + # follow redirects, fetch banner + alias clb='curl -L -I' + # see only response headers from a get request + alias clhead='curl -D - -so /dev/null' + fi +} + +_set_pkg_aliases diff --git a/.bash_it/aliases/available/dnf.aliases.bash b/.bash_it/aliases/available/dnf.aliases.bash new file mode 100644 index 0000000..9d9f026 --- /dev/null +++ b/.bash_it/aliases/available/dnf.aliases.bash @@ -0,0 +1,18 @@ +# shellcheck shell=bash +cite 'about-alias' +about-alias 'dnf aliases for fedora 22+ distros' + +alias dnfl="dnf list" # List packages +alias dnfli="dnf list installed" # List installed packages +alias dnfgl="dnf grouplist" # List package groups +alias dnfmc="dnf makecache" # Generate metadata cache +alias dnfp="dnf info" # Show package information +alias dnfs="dnf search" # Search package + +alias dnfu="sudo dnf upgrade" # Upgrade package +alias dnfi="sudo dnf install" # Install package +alias dnfri='sudo dnf reinstall' # Reinstall package +alias dnfgi="sudo dnf groupinstall" # Install package group +alias dnfr="sudo dnf remove" # Remove package +alias dnfgr="sudo dnf groupremove" # Remove package group +alias dnfc="sudo dnf clean all" # Clean cache diff --git a/.bash_it/aliases/available/docker-compose.aliases.bash b/.bash_it/aliases/available/docker-compose.aliases.bash new file mode 100644 index 0000000..3583be8 --- /dev/null +++ b/.bash_it/aliases/available/docker-compose.aliases.bash @@ -0,0 +1,10 @@ +cite 'about-alias' +about-alias 'docker-compose abbreviations' + +alias dco="docker-compose" + +# Defined in the `docker-compose` plugin, please check there for details. +alias dcofresh="docker-compose-fresh" +alias dcol="docker-compose logs -f --tail 100" +alias dcou="docker-compose up" +alias dcouns="dcou --no-start" diff --git a/.bash_it/aliases/available/docker.aliases.bash b/.bash_it/aliases/available/docker.aliases.bash new file mode 100644 index 0000000..9f005aa --- /dev/null +++ b/.bash_it/aliases/available/docker.aliases.bash @@ -0,0 +1,43 @@ +cite 'about-alias' +about-alias 'docker abbreviations' + +alias dk='docker' +alias dklc='docker ps -l' # List last Docker container +alias dklcid='docker ps -l -q' # List last Docker container ID +alias dklcip='docker inspect -f "{{.NetworkSettings.IPAddress}}" $(docker ps -l -q)' # Get IP of last Docker container +alias dkps='docker ps' # List running Docker containers +alias dkpsa='docker ps -a' # List all Docker containers +alias dki='docker images' # List Docker images +alias dkrmac='docker rm $(docker ps -a -q)' # Delete all Docker containers + +case $OSTYPE in + darwin*|*bsd*|*BSD*) + alias dkrmui='docker images -q -f dangling=true | xargs docker rmi' # Delete all untagged Docker images + ;; + *) + alias dkrmui='docker images -q -f dangling=true | xargs -r docker rmi' # Delete all untagged Docker images + ;; +esac + +if [ ! -z "$(command ls "${BASH_IT}/enabled/"{[0-9][0-9][0-9]${BASH_IT_LOAD_PRIORITY_SEPARATOR}docker,docker}.plugin.bash 2>/dev/null | head -1)" ]; then +# Function aliases from docker plugin: + alias dkrmlc='docker-remove-most-recent-container' # Delete most recent (i.e., last) Docker container + alias dkrmall='docker-remove-stale-assets' # Delete all untagged images and exited containers + alias dkrmli='docker-remove-most-recent-image' # Delete most recent (i.e., last) Docker image + alias dkrmi='docker-remove-images' # Delete images for supplied IDs or all if no IDs are passed as arguments + alias dkideps='docker-image-dependencies' # Output a graph of image dependencies using Graphiz + alias dkre='docker-runtime-environment' # List environmental variables of the supplied image ID +fi +alias dkelc='docker exec -it $(dklcid) bash --login' # Enter last container (works with Docker 1.3 and above) +alias dkrmflast='docker rm -f $(dklcid)' +alias dkbash='dkelc' +alias dkex='docker exec -it ' # Useful to run any commands into container without leaving host +alias dkri='docker run --rm -i ' +alias dkric='docker run --rm -i -v $PWD:/cwd -w /cwd ' +alias dkrit='docker run --rm -it ' +alias dkritc='docker run --rm -it -v $PWD:/cwd -w /cwd ' + +# Added more recent cleanup options from newer docker versions +alias dkip='docker image prune -a -f' +alias dkvp='docker volume prune -f' +alias dksp='docker system prune -a -f' diff --git a/.bash_it/aliases/available/emacs.aliases.bash b/.bash_it/aliases/available/emacs.aliases.bash new file mode 100644 index 0000000..f8e1259 --- /dev/null +++ b/.bash_it/aliases/available/emacs.aliases.bash @@ -0,0 +1,16 @@ +cite 'about-alias' +about-alias 'emacs editor' + +case $OSTYPE in + linux*) + alias em='emacs' + alias en='emacs -nw' + alias e='emacsclient -n' + alias et='emacsclient -t' + alias ed='emacs --daemon' + alias E='SUDO_EDITOR=emacsclient sudo -e' + ;; + darwin*) + alias em='open -a emacs' + ;; +esac diff --git a/.bash_it/aliases/available/fuck.aliases.bash b/.bash_it/aliases/available/fuck.aliases.bash new file mode 100644 index 0000000..495ea85 --- /dev/null +++ b/.bash_it/aliases/available/fuck.aliases.bash @@ -0,0 +1,10 @@ +cite 'about-alias' +about-alias 'fuck/please to retry last command with sudo' + +# Play nicely with 'thefuck' plugin +if ! _command_exists fuck ; then + alias fuck='sudo $(fc -ln -1)' +fi +alias please=fuck +alias plz=please +alias fucking=sudo diff --git a/.bash_it/aliases/available/general.aliases.bash b/.bash_it/aliases/available/general.aliases.bash new file mode 100644 index 0000000..0c7bcd9 --- /dev/null +++ b/.bash_it/aliases/available/general.aliases.bash @@ -0,0 +1,102 @@ +cite about-alias +about-alias 'general aliases' + +if ls --color -d . &> /dev/null +then + alias ls="ls --color=auto" +elif ls -G -d . &> /dev/null +then + alias ls='ls -G' # Compact view, show colors +fi + +# List directory contents +alias sl=ls +alias la='ls -AF' # Compact view, show hidden +alias ll='ls -al' +alias l='ls -a' +alias l1='ls -1' + +alias _="sudo" + +# Shortcuts to edit startup files +alias vbrc="vim ~/.bashrc" +alias vbpf="vim ~/.bash_profile" + +# colored grep +# Need to check an existing file for a pattern that will be found to ensure +# that the check works when on an OS that supports the color option +if grep --color=auto "a" "${BASH_IT}/"*.md &> /dev/null +then + alias grep='grep --color=auto' +fi + +if which gshuf &> /dev/null +then + alias shuf=gshuf +fi + +alias c='clear' +alias k='clear' +alias cls='clear' + +alias edit="$EDITOR" +alias pager="$PAGER" + +alias q='exit' + +alias irc="${IRC_CLIENT:=irc}" + +# Language aliases +alias rb='ruby' +alias py='python' +alias ipy='ipython' + +# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ + +alias piano='pianobar' + +alias ..='cd ..' # Go up one directory +alias cd..='cd ..' # Common misspelling for going up one directory +alias ...='cd ../..' # Go up two directories +alias ....='cd ../../..' # Go up three directories +alias -- -='cd -' # Go back + +# Shell History +alias h='history' + +# Tree +if [ ! -x "$(which tree 2>/dev/null)" ] +then + alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" +fi + +# Directory +alias md='mkdir -p' +alias rd='rmdir' + +# Shorten extract +alias xt="extract" + +# sudo editors +alias svim="sudo vim" +alias snano="sudo nano" + +# Display whatever file is regular file or folder +catt() { + for i in "$@"; do + if [ -d "$i" ]; then + ls "$i" + else + cat "$i" + fi + done +} + +# The Bash-it aliases were moved to the `bash-it.aliases.bash` file. The intent of this +# is to keep the script readable and less bloated. If you don't need to use +# the `general` aliases, but you want the Bash-it aliases, you can disable the `general` +# aliases and enable just the ones for Bash-it explicitly: +# bash-it disable alias general +# bash-it enable alias bash-it +# shellcheck source=./bash-it.aliases.bash +source "$BASH_IT/aliases/available/bash-it.aliases.bash" diff --git a/.bash_it/aliases/available/git.aliases.bash b/.bash_it/aliases/available/git.aliases.bash new file mode 100644 index 0000000..8cafa82 --- /dev/null +++ b/.bash_it/aliases/available/git.aliases.bash @@ -0,0 +1,207 @@ +# shellcheck shell=bash +cite 'about-alias' +about-alias 'common git abbreviations' + +alias g='git' +alias get='git' + +# add +alias ga='git add' +alias gall='git add -A' +alias gap='git add -p' + +# branch +alias gb='git branch' +alias gbD='git branch -D' +alias gba='git branch -a' +alias gbd='git branch -d' +alias gbm='git branch -m' +alias gbt='git branch --track' +alias gdel='git branch -D' + +# for-each-ref +alias gbc='git for-each-ref --format="%(authorname) %09 %(if)%(HEAD)%(then)*%(else)%(refname:short)%(end) %09 %(creatordate)" refs/remotes/ --sort=authorname DESC' # FROM https://stackoverflow.com/a/58623139/10362396 + +# commit +alias gc='git commit -v' +alias gca='git commit -v -a' +alias gcaa='git commit -a --amend -C HEAD' # Add uncommitted and unstaged changes to the last commit +alias gcam='git commit -v -am' +alias gcamd='git commit --amend' +alias gcm='git commit -v -m' +alias gci='git commit --interactive' +alias gcsam='git commit -S -am' + +# checkout +alias gcb='git checkout -b' +alias gco='git checkout' +alias gcob='git checkout -b' +alias gcobu='git checkout -b ${USER}/' +alias gcom='git checkout $(get_default_branch)' +alias gcpd='git checkout $(get_default_branch); git pull; git branch -D' +alias gct='git checkout --track' + +# clone +alias gcl='git clone' + +# clean +alias gclean='git clean -fd' + +# cherry-pick +alias gcp='git cherry-pick' +alias gcpx='git cherry-pick -x' + +# diff +alias gd='git diff' +alias gds='git diff --staged' +alias gdt='git difftool' + +# archive +alias gexport='git archive --format zip --output' + +# fetch +alias gf='git fetch --all --prune' +alias gft='git fetch --all --prune --tags' +alias gftv='git fetch --all --prune --tags --verbose' +alias gfv='git fetch --all --prune --verbose' +alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/$(get_default_branch)' +alias gup='git fetch && git rebase' + +# log +alias gg='git log --graph --pretty=format:'\''%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset'\'' --abbrev-commit --date=relative' +alias ggf='git log --graph --date=short --pretty=format:'\''%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'\''' +alias ggs='gg --stat' +alias ggup='git log --branches --not --remotes --no-walk --decorate --oneline' # FROM https://stackoverflow.com/questions/39220870/in-git-list-names-of-branches-with-unpushed-commits +alias gll='git log --graph --pretty=oneline --abbrev-commit' +alias gnew='git log HEAD@{1}..HEAD@{0}' # Show commits since last pull, see http://blogs.atlassian.com/2014/10/advanced-git-aliases/ +alias gwc='git whatchanged' + +# ls-files +alias gu='git ls-files . --exclude-standard --others' # Show untracked files +alias glsut='gu' +alias glsum='git diff --name-only --diff-filter=U' # Show unmerged (conflicted) files + +# gui +alias ggui='git gui' + +# home +alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home +# appendage to ghm +if ! _command_exists gh; then + alias gh='ghm' +fi + +# merge +alias gm='git merge' + +# mv +alias gmv='git mv' + +# patch +alias gpatch='git format-patch -1' + +# push +alias gp='git push' +alias gpd='git push --delete' +alias gpf='git push --force' +alias gpo='git push origin HEAD' +alias gpom='git push origin $(get_default_branch)' +alias gpu='git push --set-upstream' +alias gpunch='git push --force-with-lease' +alias gpuo='git push --set-upstream origin' +alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)' + +# pull +alias gl='git pull' +alias glum='git pull upstream $(get_default_branch)' +alias gpl='git pull' +alias gpp='git pull && git push' +alias gpr='git pull --rebase' + +# remote +alias gr='git remote' +alias gra='git remote add' +alias grv='git remote -v' + +# rm +alias grm='git rm' + +# rebase +alias grb='git rebase' +alias grbc='git rebase --continue' +alias grm='git rebase $(get_default_branch)' +alias grmi='git rebase $(get_default_branch) -i' +alias gprom='git fetch origin $(get_default_branch) && git rebase origin/$(get_default_branch) && git update-ref refs/heads/$(get_default_branch) origin/$(get_default_branch)' # Rebase with latest remote + +# reset +alias gus='git reset HEAD' +alias gpristine='git reset --hard && git clean -dfx' + +# status +alias gs='git status' +alias gss='git status -s' + +# shortlog +alias gcount='git shortlog -sn' +alias gsl='git shortlog -sn' + +# show +alias gsh='git show' + +# svn +alias gsd='git svn dcommit' +alias gsr='git svn rebase' # Git SVN + +# stash +alias gst='git stash' +alias gstb='git stash branch' +alias gstd='git stash drop' +alias gstl='git stash list' +alias gstp='git stash pop' # kept due to long-standing usage +alias gstpo='git stash pop' # recommended for it's symmetry with gstpu (push) + +## 'stash push' introduced in git v2.13.2 +alias gstpu='git stash push' +alias gstpum='git stash push -m' + +## 'stash save' deprecated since git v2.16.0, alias is now push +alias gsts='git stash push' +alias gstsm='git stash push -m' + +# submodules +alias gsu='git submodule update --init --recursive' + +# switch +# these aliases requires git v2.23+ +alias gsw='git switch' +alias gswc='git switch --create' +alias gswm='git switch $(get_default_branch)' +alias gswt='git switch --track' + +# tag +alias gt='git tag' +alias gta='git tag -a' +alias gtd='git tag -d' +alias gtl='git tag -l' + +case $OSTYPE in + darwin*) + alias gtls="git tag -l | gsort -V" + ;; + *) + alias gtls='git tag -l | sort -V' + ;; +esac + +# functions +function gdv() { + git diff --ignore-all-space "$@" | vim -R - +} + +function get_default_branch() { + if git branch | grep -q main; then + echo main + else + echo master + fi +} diff --git a/.bash_it/aliases/available/gitsvn.aliases.bash b/.bash_it/aliases/available/gitsvn.aliases.bash new file mode 100644 index 0000000..feb608b --- /dev/null +++ b/.bash_it/aliases/available/gitsvn.aliases.bash @@ -0,0 +1,7 @@ +cite 'about-alias' +about-alias 'common git-svn abbreviations' + +# Aliases +alias gsr='git svn rebase' +alias gsc='git svn dcommit' +alias gsi='git svn info' diff --git a/.bash_it/aliases/available/heroku.aliases.bash b/.bash_it/aliases/available/heroku.aliases.bash new file mode 100644 index 0000000..a749d42 --- /dev/null +++ b/.bash_it/aliases/available/heroku.aliases.bash @@ -0,0 +1,34 @@ +cite 'about-alias' +about-alias 'heroku task abbreviations' + +# heroku +alias h='heroku' +alias hl='heroku list' +alias hi='heroku info' +alias ho='heroku open' + +# dynos and workers +alias hd='heroku dynos' +alias hw='heroku workers' + +# rake console +alias hr='heroku rake' +alias hcon='heroku console' + +# new and restart +alias hnew='heroku create' +alias hrestart='heroku restart' + +# logs +alias hlog='heroku logs' +alias hlogs='heroku logs' + +# maint +alias hon='heroku maintenance:on' +alias hoff='heroku maintenance:off' + +# heroku configs +alias hc='heroku config' +alias hca='heroku config:add' +alias hcr='heroku config:remove' +alias hcc='heroku config:clear' diff --git a/.bash_it/aliases/available/hg.aliases.bash b/.bash_it/aliases/available/hg.aliases.bash new file mode 100644 index 0000000..eea819f --- /dev/null +++ b/.bash_it/aliases/available/hg.aliases.bash @@ -0,0 +1,6 @@ +cite 'about-alias' +about-alias 'mercurial abbreviations' + +alias hs='hg status' +alias hsum='hg summary' +alias hcm='hg commit -m' diff --git a/.bash_it/aliases/available/homebrew-cask.aliases.bash b/.bash_it/aliases/available/homebrew-cask.aliases.bash new file mode 100644 index 0000000..57d8161 --- /dev/null +++ b/.bash_it/aliases/available/homebrew-cask.aliases.bash @@ -0,0 +1,13 @@ +# Some aliases for Homebrew Cask + +cite 'about-alias' +about-alias 'homebrew-cask abbreviations' + +alias bcin='brew cask install' +alias bcrm='brew cask uninstall' +alias bczp='brew cask zap' +alias bccl='brew cask cleanup' +alias bcls='brew cask list' +alias bcinf='brew cask info' +alias bcdr='brew cask doctor' +alias bced='brew cask edit' diff --git a/.bash_it/aliases/available/homebrew.aliases.bash b/.bash_it/aliases/available/homebrew.aliases.bash new file mode 100644 index 0000000..1590751 --- /dev/null +++ b/.bash_it/aliases/available/homebrew.aliases.bash @@ -0,0 +1,15 @@ +# Some aliases for Homebrew + +cite 'about-alias' +about-alias 'homebrew abbreviations' + +alias bup='brew update && brew upgrade' +alias bout='brew outdated' +alias bin='brew install' +alias brm='brew uninstall' +alias bcl='brew cleanup' +alias bls='brew list' +alias bsr='brew search' +alias binf='brew info' +alias bdr='brew doctor' +alias bed='brew edit' diff --git a/.bash_it/aliases/available/homesick.aliases.bash b/.bash_it/aliases/available/homesick.aliases.bash new file mode 100644 index 0000000..548efc3 --- /dev/null +++ b/.bash_it/aliases/available/homesick.aliases.bash @@ -0,0 +1,24 @@ +cite 'about-alias' +about-alias 'homesick aliases' + +# Aliases +alias sikhm="homesick cd dotfiles" +alias sikclone="homesick clone" +alias sikcomt="homesick commit dotfiles" +alias sikdstry="homesick destroy" +alias sikdif="homesick diff dotfiles" +alias sikexec="homesick exec dotfiles" +alias sikexeca="homesick exec_all" +alias sikgen="homesick generate" +alias sikhlp="homesick help" +alias siklnk="homesick link dotfiles" +alias sikls="homesick list" +alias sikopn="homesick open dotfiles" +alias sikpll="homesick pull dotfiles" +alias sikpsh="homesick push dotfiles" +alias sikrc="homesick rc dotfiles" +alias sikpth="homesick show_path dotfiles" +alias sikst="homesick status dotfiles" +alias siktrk="homesick track $1 dotfiles" +alias sikulnk="homesick unlink dotfiles" +alias sikv="homesick version" diff --git a/.bash_it/aliases/available/jitsu.aliases.bash b/.bash_it/aliases/available/jitsu.aliases.bash new file mode 100644 index 0000000..91e9684 --- /dev/null +++ b/.bash_it/aliases/available/jitsu.aliases.bash @@ -0,0 +1,49 @@ +cite 'about-alias' +about-alias 'jitsu task abbreviations' + +# jitsu +alias j='jitsu' +alias jl='jitsu login' +alias jo='jitsu logout' + +# deploy and update +alias jd='jitsu apps deploy' +alias ju='jitsu apps update' + +# new and start, restart, stop +alias jn='jitsu apps create' +alias js='jitsu apps start' +alias jr='jitsu apps restart' +alias jx='jitsu apps stop' + +# logs +alias jll='jitsu logs' +alias jlog='jitsu logs' +alias jlogs='jitsu logs' + +# env +alias je='jitsu env' +alias jel='jitsu env list' +alias jes='jitsu env set' +alias jeg='jitsu env get' +alias jed='jitsu env delete' +alias jec='jitsu env clear' +alias jesv='jitsu env save' +alias jeld='jitsu env load' + +# configuration +alias jc='jitsu conf' +alias jcl='jitsu config list' +alias jcs='jitsu config set' +alias jcg='jitsu config get' +alias jcd='jitsu config delete' + +# list and install, view +alias jls='jitsu list' +alias jin='jitsu install' +alias jv='jitsu apps view' + +# Database, Snapshots and Tokens +alias jdb='jitsu databases' +alias jss='jitsu snapshots' +alias jto='jitsu tokens' diff --git a/.bash_it/aliases/available/kubectl.aliases.bash b/.bash_it/aliases/available/kubectl.aliases.bash new file mode 100644 index 0000000..440a904 --- /dev/null +++ b/.bash_it/aliases/available/kubectl.aliases.bash @@ -0,0 +1,25 @@ +#!/bin/bash +# +# -binaryanomaly + +cite 'about-alias' +about-alias 'kubectl aliases' + +function _set_pkg_aliases() +{ + if _command_exists kubectl; then + alias kc='kubectl' + alias kcgp='kubectl get pods' + alias kcgd='kubectl get deployments' + alias kcgn='kubectl get nodes' + alias kcdp='kubectl describe pod' + alias kcdd='kubectl describe deployment' + alias kcdn='kubectl describe node' + alias kcgpan='kubectl get pods --all-namespaces' + alias kcgdan='kubectl get deployments --all-namespaces' + # launches a disposable netshoot pod in the k8s cluster + alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash' + fi +} + +_set_pkg_aliases diff --git a/.bash_it/aliases/available/laravel.aliases.bash b/.bash_it/aliases/available/laravel.aliases.bash new file mode 100644 index 0000000..75a51a0 --- /dev/null +++ b/.bash_it/aliases/available/laravel.aliases.bash @@ -0,0 +1,74 @@ +cite 'about-alias' +about-alias 'laravel artisan abbreviations' + +# A list of useful laravel aliases + +alias laravel="${HOME}/.composer/vendor/bin/laravel" +# asset +alias a:apub='php artisan asset:publish' + +# auth +alias a:remclear='php artisan auth:clear-reminders' +alias a:remcontroller='php artisan auth:reminders-controller' +alias a:remtable='php artisan auth:reminders-table' + +# cache +alias a:cacheclear='php artisan cache:clear' + +# command +alias a:command='php artisan command:make' + +# config +alias a:confpub='php artisan config:publish' + +# controller +alias a:controller='php artisan make:controller' + +# db +alias a:seed='php artisan db:seed' + +# key +alias a:key='php artisan key:generate' + +# migrate +alias a:migrate='php artisan migrate' +alias a:mig='a:migrate' +alias a:miginstall='php artisan migrate:install' +alias a:migmake='php artisan migrate:make' +alias a:migcreate='php artisan migrate:create' +alias a:migpublish='php artisan migrate:publish' +alias a:migrefresh='php artisan migrate:refresh' +alias a:migreset='php artisan migrate:reset' +alias a:migrollback='php artisan migrate:rollback' +alias a:rollback='a:migrollback' + +# queue +alias a:qfailed='php artisan queue:failed' +alias a:qfailedtable='php artisan queue:failed-table' +alias a:qflush='php artisan queue:flush' +alias a:qforget='php artisan queue:forget' +alias a:qlisten='php artisan queue:listen' +alias a:qretry='php artisan queue:retry' +alias a:qsubscribe='php artisan queue:subscribe' +alias a:qwork='php artisan queue:work' + +# session +alias a:stable='php artisan session:table' + +# view +alias a:vpub='php artisan view:publish' + +# misc +alias a:='php artisan' +alias a:changes='php artisan changes' +alias a:down='php artisan down' +alias a:env='php artisan env' +alias a:help='php artisan help' +alias a:list='php artisan list' +alias a:optimize='php artisan optimize' +alias a:routes='php artisan routes' +alias a:serve='php artisan serve' +alias a:tail='php artisan tail' +alias a:tinker='php artisan tinker' +alias a:up='php artisan up' +alias a:work='php artisan workbench' diff --git a/.bash_it/aliases/available/maven.aliases.bash b/.bash_it/aliases/available/maven.aliases.bash new file mode 100644 index 0000000..f8a44a1 --- /dev/null +++ b/.bash_it/aliases/available/maven.aliases.bash @@ -0,0 +1,14 @@ +cite 'about-alias' +about-alias 'maven abbreviations' + +alias mci='mvn clean install' +alias mi='mvn install' +alias mcp='mvn clean package' +alias mp='mvn package' +alias mrprep='mvn release:prepare' +alias mrperf='mvn release:perform' +alias mrrb='mvn release:rollback' +alias mdep='mvn dependency:tree' +alias mpom='mvn help:effective-pom' +alias mcisk='mci -Dmaven.test.skip=true' +alias mcpsk='mcp -Dmaven.test.skip=true' diff --git a/.bash_it/aliases/available/msys2.aliases.bash b/.bash_it/aliases/available/msys2.aliases.bash new file mode 100644 index 0000000..a309a5b --- /dev/null +++ b/.bash_it/aliases/available/msys2.aliases.bash @@ -0,0 +1,15 @@ +#!/bin/bash + +cite 'about-alias' +about-alias 'MSYS2 aliases' + +LS_COMMON="-hG" +LS_COMMON="$LS_COMMON --color=auto" +LS_COMMON="$LS_COMMON -I NTUSER.DAT\* -I ntuser.dat\*" + +# alias +# setup the main ls alias if we've established common args +test -n "$LS_COMMON" && alias ls="command ls $LS_COMMON" +alias ll="ls -l" +alias la="ls -a" +alias lal="ll -a" diff --git a/.bash_it/aliases/available/node.aliases.bash b/.bash_it/aliases/available/node.aliases.bash new file mode 100644 index 0000000..a1408f2 --- /dev/null +++ b/.bash_it/aliases/available/node.aliases.bash @@ -0,0 +1,8 @@ +cite 'about-alias' +about-alias 'the Node.js environment aliases' + +# alias to setup nodejs development environment +alias node-dev='export NODE_ENV=development' + +# alias to setup nodejs production environment +alias node-prod='export NODE_ENV=production' diff --git a/.bash_it/aliases/available/npm.aliases.bash b/.bash_it/aliases/available/npm.aliases.bash new file mode 100644 index 0000000..bd742d5 --- /dev/null +++ b/.bash_it/aliases/available/npm.aliases.bash @@ -0,0 +1,43 @@ +cite 'about-alias' +about-alias 'common npm abbreviations' + +# Aliases + +# npm +alias ni='npm install' +alias nis='npm install --save' +alias nid='npm install --save-dev' +alias nit='npm install-test' +alias nits='npm install-test --save' +alias nitd='npm install-test --save-dev' +alias nu='npm uninstall' +alias nus='npm uninstall --save' +alias nusd='npm uninstall --save-dev' +alias np='npm publish' +alias nup='npm unpublish' +alias nlk='npm link' +alias nod='npm outdated' +alias nrb='npm rebuild' +alias nud='npm update' +alias nr='npm run' +alias nls='npm list --depth=0 2>/dev/null' +alias nlsg='npm list -g --depth=0 2>/dev/null' +alias nt='npm test' + +# npx +alias nx='npx' +alias nxplease='npx $(fc -ln -1)' +alias nxn='npx --no-install ' +alias nxp='npx -p ' +alias nxnp='npx --no-install -p ' +alias nxq='npx -q ' +alias nxnq='npx --no-install -q ' +alias nxqp='npx -q -p ' +alias nxnqp='npx --no-install -q -p ' +alias nxni='npx --no-install --ignore-existing ' +alias nxip='npx --ignore-existing -p ' +alias nxnip='npx --no-install --ignore-existing -p ' +alias nxqi='npx -q --ignore-existing ' +alias nxniq='npx --no-install --ignore-existing -q ' +alias nxiqp='npx --ignore-existing -q -p ' +alias nxniqp='npx --no-install --ignore-existing -q -p ' diff --git a/.bash_it/aliases/available/osx.aliases.bash b/.bash_it/aliases/available/osx.aliases.bash new file mode 100644 index 0000000..5e30bc7 --- /dev/null +++ b/.bash_it/aliases/available/osx.aliases.bash @@ -0,0 +1,55 @@ +cite 'about-alias' +about-alias 'osx-specific aliases' + +# Desktop Programs +alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'" +alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'" +alias preview="open -a '$PREVIEW'" +alias xcode="open -a '/Applications/XCode.app'" +alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'" +alias safari="open -a safari" +alias firefox="open -a firefox" +alias chrome="open -a google\ chrome" +alias chromium="open -a chromium" +alias dashcode="open -a dashcode" +alias f='open -a Finder ' +alias fh='open -a Finder .' +alias textedit='open -a TextEdit' +alias hex='open -a "Hex Fiend"' +alias skype='open -a Skype' +alias mou='open -a Mou' +alias subl='open -a Sublime\ Text' + +if [ -s /usr/bin/firefox ] ; then + unalias firefox +fi + +# Requires growlnotify, which can be found in the Growl DMG under "Extras" +alias grnot='growlnotify -s -t Terminal -m "Done"' + +# Get rid of those pesky .DS_Store files recursively +alias dsclean='find . -type f -name .DS_Store -delete' + +# Track who is listening to your iTunes music +alias whotunes='lsof -r 2 -n -P -F n -c iTunes -a -i TCP@`hostname`:3689' + +# Flush your dns cache +alias flush='dscacheutil -flushcache' + +# Show/hide hidden files (for Mac OS X Mavericks) +alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE" +alias hidehidden="defaults write com.apple.finder AppleShowAllFiles FALSE" + +# From http://apple.stackexchange.com/questions/110343/copy-last-command-in-terminal +alias copyLastCmd='fc -ln -1 | awk '\''{$1=$1}1'\'' ORS='\'''\'' | pbcopy' + +# Use Finder's Quick Look on a file (^C or space to close) +alias ql='qlmanage -p 2>/dev/null' + +# Mute/Unmute the system volume. Plays nice with all other volume settings. +alias mute="osascript -e 'set volume output muted true'" +alias unmute="osascript -e 'set volume output muted false'" + +# Pin to the tail of long commands for an audible alert after long processes +## curl http://downloads.com/hugefile.zip; lmk +alias lmk="say 'Process complete.'" diff --git a/.bash_it/aliases/available/phoenix.aliases.bash b/.bash_it/aliases/available/phoenix.aliases.bash new file mode 100644 index 0000000..64728a2 --- /dev/null +++ b/.bash_it/aliases/available/phoenix.aliases.bash @@ -0,0 +1,49 @@ +cite 'about-alias' +about-alias 'phoenix abbreviations' + +# Phoenix Commands +alias i='iex' +alias ips='iex -S mix phx.server' +alias ism='iex -S mix' +alias m='mix' +alias mab='mix archive.build' +alias mai='mix archive.install' +alias mat='mix app.tree' +alias mc='mix compile' +alias mcv='mix compile --verbose' +alias mcx='mix compile.xref' +alias mdc='mix deps.compile' +alias mdg='mix deps.get' +alias mdgc='mix do deps.get, deps.compile' +alias mdu='mix deps.update' +alias mdt='mix deps.tree' +alias mdua='mix deps.update --all' +alias mdun='mix deps.unlock' +alias mduu='mix deps.unlock --unused' +alias meb='mix escript.build' +alias mec='mix ecto.create' +alias mecm='mix do ecto.create, ecto.migrate' +alias med='mix ecto.drop' +alias mem='mix ecto.migrate' +alias megm='mix ecto.gen.migration' +alias merb='mix ecto.rollback' +alias mers='mix ecto.reset' +alias mho='mix hex.outdated' +alias mlh='mix local.hex' +alias mn='mix new' +alias mns='mix new --sup' +alias mpgc='mix phx.gen.channel' +alias mpgh='mix phx.gen.html' +alias mpgj='mix phx.gen.json' +alias mpgm='mix phx.gen.model' +alias mpgs='mix phx.gen.secret' +alias mpn='mix phx.new' +alias mpr='mix phx.routes' +alias mps='mix phx.server' +alias mr='mix run' +alias mrnh='mix run --no-halt' +alias mrl='mix release' +alias mt='mix test' +alias mts='mix test --stale' +alias mtw='mix test.watch' +alias mx='mix xref' diff --git a/.bash_it/aliases/available/puppet.aliases.bash b/.bash_it/aliases/available/puppet.aliases.bash new file mode 100644 index 0000000..15b6992 --- /dev/null +++ b/.bash_it/aliases/available/puppet.aliases.bash @@ -0,0 +1,9 @@ +cite 'about-alias' +about-alias 'puppet aliases' + +# Aliases +alias pupval="puppet parser validate *.pp" +alias puplint="puppet-lint *.pp" +alias pupagt="puppet agent -t" +alias pupagtd="puppet agent -t --debug" +alias pupapp="puppet apply" diff --git a/.bash_it/aliases/available/pyrocms.aliases.bash b/.bash_it/aliases/available/pyrocms.aliases.bash new file mode 100644 index 0000000..d19dff9 --- /dev/null +++ b/.bash_it/aliases/available/pyrocms.aliases.bash @@ -0,0 +1,152 @@ +cite 'about-alias' +about-alias 'pyrocms abbreviations' + +### +## PyroCMS 3.4 bash aliases +## @author Denis Efremov +### + +# general +alias a:cl="php artisan clear-compiled" # Remove the compiled class file +alias a:d="php artisan down" # Put the application into maintenance mode +alias a:e="php artisan env" # Display the current framework environment +alias a:h="php artisan help" # Displays help for a command +alias a:i="php artisan install" # Install the Streams Platform. +alias a:ls="php artisan list" # Lists commands +alias a:mg="php artisan migrate" # Run the database migrations +alias a:op="php artisan optimize" # Optimize the framework for better performance (deprecated) +alias a:pr="php artisan preset" # Swap the front-end scaffolding for the application +alias a:s="php artisan serve" # Serve the application on the PHP development server +alias a:u="php artisan up" # Bring the application out of maintenance mode + +# addon +alias a:ad:i="php artisan addon:install" # Install an addon. +alias a:ad:p="php artisan addon:publish" # Publish an the configuration and translations for an addon. +alias a:ad:r="php artisan addon:reinstall" # Reinstall an addon. +alias a:ad:u="php artisan addon:uninstall" # Uninstall an addon. + +# app +alias a:ap:n="php artisan app:name" # Set the application namespace +alias a:ap:p="php artisan app:publish" # Publish general application override files. + +# assets +alias a:as:cl="php artisan assets:clear" # Clear compiled public assets. + +# auth +alias a:au:clrs="php artisan auth:clear-resets" # Flush expired password reset tokens + +# cache +alias a:ca:cl="php artisan cache:clear" # Flush the application cache +alias a:ca:f="php artisan cache:forget" # Remove an item from the cache +alias a:ca:t="php artisan cache:table" # Create a migration for the cache database table + +# config +alias a:co:ca="php artisan config:cache" # Create a cache file for faster configuration loading +alias a:co:cl="php artisan config:clear" # Remove the configuration cache file + +# db +alias a:db:s="php artisan db:seed" # Seed the database with records + +# env +alias a:en:s="php artisan env:set" # Set an environmental value. + +# event +alias a:ev:g="php artisan event:generate" # Generate the missing events and listeners based on registration + +# extension +alias a:ex:i="php artisan extension:install" # Install a extension. +alias a:ex:r="php artisan extension:reinstall" # Reinstall a extension. +alias a:ex:u="php artisan extension:uninstall" # Uninstall a extension. + +# files +alias a:fi:cl="php artisan files:clean" # Clean missing files from the files table. + +# key +alias a:ke:g="php artisan key:generate" # Set the application key + +# make +alias a:mk:ad="php artisan make:addon" # Create a new addon. +alias a:mk:au="php artisan make:auth" # Scaffold basic login and registration views and routes +alias a:mk:cm="php artisan make:command" # Create a new Artisan command +alias a:mk:ct="php artisan make:controller" # Create a new controller class +alias a:mk:ev="php artisan make:event" # Create a new event class +alias a:mk:fa="php artisan make:factory" # Create a new model factory +alias a:mk:j="php artisan make:job" # Create a new job class +alias a:mk:li="php artisan make:listener" # Create a new event listener class +alias a:mk:ma="php artisan make:mail" # Create a new email class +alias a:mk:mw="php artisan make:middleware" # Create a new middleware class +alias a:mk:mg="php artisan make:migration" # Create a new migration file +alias a:mk:md="php artisan make:model" # Create a new Eloquent model class +alias a:mk:no="php artisan make:notification" # Create a new notification class +alias a:mk:po="php artisan make:policy" # Create a new policy class +alias a:mk:pr="php artisan make:provider" # Create a new service provider class +alias a:mk:rq="php artisan make:request" # Create a new form request class +alias a:mk:rs="php artisan make:resource" # Create a new resource +alias a:mk:rl="php artisan make:rule" # Create a new validation rule +alias a:mk:sd="php artisan make:seeder" # Create a new seeder class +alias a:mk:st="php artisan make:stream" # Make a streams entity namespace. +alias a:mk:ts="php artisan make:test" # Create a new test class + +# migrate +alias a:mg:fr="php artisan migrate:fresh" # Drop all tables and re-run all migrations +alias a:mg:i="php artisan migrate:install" # Create the migration repository +alias a:mg:rf="php artisan migrate:refresh" # Reset and re-run all migrations +alias a:mg:rs="php artisan migrate:reset" # Rollback all database migrations +alias a:mg:rl="php artisan migrate:rollback" # Rollback the last database migration +alias a:mg:st="php artisan migrate:status" # Show the status of each migration + +# module +alias a:mo:i="php artisan module:install" # Install a module. +alias a:mo:r="php artisan module:reinstall" # Reinstall a module. +alias a:mo:u="php artisan module:uninstall" # Uninstall a module. + +# notifications +alias a:no:tb="php artisan notifications:table" # Create a migration for the notifications table + +# package +alias a:pk:d="php artisan package:discover" # Rebuild the cached package manifest + +# queue +alias a:qu:fa="php artisan queue:failed" # List all of the failed queue jobs +alias a:qu:ft="php artisan queue:failed-table" # Create a migration for the failed queue jobs database table +alias a:qu:fl="php artisan queue:flush" # Flush all of the failed queue jobs +alias a:qu:fg="php artisan queue:forget" # Delete a failed queue job +alias a:qu:li="php artisan queue:listen" # Listen to a given queue +alias a:qu:rs="php artisan queue:restart" # Restart queue worker daemons after their current job +alias a:qu:rt="php artisan queue:retry" # Retry a failed queue job +alias a:qu:tb="php artisan queue:table" # Create a migration for the queue jobs database table +alias a:qu:w="php artisan queue:work" # Start processing jobs on the queue as a daemon + +# route +alias a:ro:ca="php artisan route:cache" # Create a route cache file for faster route registration +alias a:ro:cl="php artisan route:clear" # Remove the route cache file +alias a:ro:ls="php artisan route:list" # List all registered routes + +# schedule +alias a:sc:r="php artisan schedule:run" # Run the scheduled commands + +# scout +alias a:su:fl="php artisan scout:flush" # Flush all of the model's records from the index +alias a:su:im="php artisan scout:import" # Import the given model into the search index + +# session +alias a:se:tb="php artisan session:table" # Create a migration for the session database table + +# storage +alias a:sg:l="php artisan storage:link" # Create a symbolic link from "public/storage" to "storage/app/public" + +# streams +alias a:st:cl="php artisan streams:cleanup" # Cleanup streams entry models. +alias a:st:co="php artisan streams:compile" # Compile streams entry models. +alias a:st:d="php artisan streams:destroy" # Destroy a namespace. +alias a:st:p="php artisan streams:publish" # Publish configuration and translations for streams. +alias a:st:r="php artisan streams:refresh" # Refresh streams generated components. + +# tntsearch +alias a:tn:im="php artisan tntsearch:import" # Import the given model into the search index + +# vendor +alias a:ve:p="php artisan vendor:publish" # Publish any publishable assets from vendor packages + +# view +alias a:vi:cl="php artisan view:clear" # Clear all compiled view files diff --git a/.bash_it/aliases/available/rails.aliases.bash b/.bash_it/aliases/available/rails.aliases.bash new file mode 100644 index 0000000..c776660 --- /dev/null +++ b/.bash_it/aliases/available/rails.aliases.bash @@ -0,0 +1,22 @@ +cite 'about-alias' +about-alias 'rails abbreviations' + +# Rails Commands +alias r='rails' +alias rg='rails g' +alias rs='rails s' +alias rc='rails c' +alias rn='rails new' +alias rb='rails dbconsole' +alias rp='rails plugin' +alias ra='rails application' +alias rd='rails destroy' +alias dbm='rake db:migrate' + +alias ss='script/server' +alias ts="thin start" # thin server +alias sc='script/console' +alias restartapp='touch tmp/restart.txt' +alias restart='touch tmp/restart.txt' # restart passenger +alias devlog='tail -f log/development.log' +alias taild='tail -f log/development.log' # tail dev log diff --git a/.bash_it/aliases/available/svn.aliases.bash b/.bash_it/aliases/available/svn.aliases.bash new file mode 100644 index 0000000..3d6d263 --- /dev/null +++ b/.bash_it/aliases/available/svn.aliases.bash @@ -0,0 +1,15 @@ +cite 'about-alias' +about-alias 'common svn abbreviations' + +# Aliases +alias svs='svn status' +alias sa='svn add' +alias sci='svn ci -m' +alias sco='svn co' +alias sup='svn up' +alias scu='svn cleanup' +alias sli='svn list' +alias sdel='svn delete' +alias sdif='svn diff' +alias slog='svn log' +alias smv='svn move' diff --git a/.bash_it/aliases/available/systemd.aliases.bash b/.bash_it/aliases/available/systemd.aliases.bash new file mode 100644 index 0000000..19b0eae --- /dev/null +++ b/.bash_it/aliases/available/systemd.aliases.bash @@ -0,0 +1,22 @@ +cite 'about-alias' +about-alias 'systemd service' + +case $OSTYPE in + linux*) +# Improve aliases by bringing the common root `sc|scd` + `sre` for action + `u` for user + alias sc='systemctl' + alias scu='systemctl --user' + alias scdr='systemctl daemon-reload' + alias scdru='systemctl --user daemon-reload' + alias scr='systemctl restart' + alias scru='systemctl --user restart' + alias sce='systemctl stop' + alias sceu='systemctl --user stop' + alias scs='systemctl start' + alias scsu='systemctl --user start' +# Keeping previous aliases for a non-breaking change. + alias scue='sceu' + alias scus='scsu' + alias scur='scdru' + ;; +esac diff --git a/.bash_it/aliases/available/terraform.aliases.bash b/.bash_it/aliases/available/terraform.aliases.bash new file mode 100644 index 0000000..0938086 --- /dev/null +++ b/.bash_it/aliases/available/terraform.aliases.bash @@ -0,0 +1,10 @@ +# Aliases for Terraform and Terragrunt + +cite 'about-alias' +about-alias 'Terraform abbreviations' + +alias tf='terraform' +alias tfv='terraform validate' +alias tfp='terraform plan' +alias tfa='terraform apply' +alias tfd='terraform destroy' diff --git a/.bash_it/aliases/available/terragrunt.aliases.bash b/.bash_it/aliases/available/terragrunt.aliases.bash new file mode 100644 index 0000000..9395b35 --- /dev/null +++ b/.bash_it/aliases/available/terragrunt.aliases.bash @@ -0,0 +1,15 @@ +# Aliases for Terraform and Terragrunt + +cite 'about-alias' +about-alias 'Terragrunt abbreviations' + +alias tg='terragrunt' +alias tgv='terragrunt validate' +alias tgp='terragrunt plan' +alias tga='terragrunt apply' +alias tgd='terragrunt destroy' + +alias tgva='terragrunt validate-all' +alias tgpa='terragrunt plan-all' +alias tgaa='terragrunt apply-all' +alias tgda='terragrunt destroy-all' diff --git a/.bash_it/aliases/available/textmate.aliases.bash b/.bash_it/aliases/available/textmate.aliases.bash new file mode 100644 index 0000000..f0f69e4 --- /dev/null +++ b/.bash_it/aliases/available/textmate.aliases.bash @@ -0,0 +1,10 @@ +cite 'about-alias' +about-alias 'textmate abbreviations' + +case $OSTYPE in + darwin*) + # Textmate + alias e='mate . &' + alias et='mate app config db lib public script test spec config.ru Gemfile Rakefile README &' + ;; +esac diff --git a/.bash_it/aliases/available/tmux.aliases.bash b/.bash_it/aliases/available/tmux.aliases.bash new file mode 100644 index 0000000..1b07f14 --- /dev/null +++ b/.bash_it/aliases/available/tmux.aliases.bash @@ -0,0 +1,6 @@ +cite 'about-alias' +about-alias 'Tmux terminal multiplexer' + +alias txl='tmux ls' +alias txn='tmux new -s' +alias txa='tmux a -t' diff --git a/.bash_it/aliases/available/todo.txt-cli.aliases.bash b/.bash_it/aliases/available/todo.txt-cli.aliases.bash new file mode 100644 index 0000000..5bf35d0 --- /dev/null +++ b/.bash_it/aliases/available/todo.txt-cli.aliases.bash @@ -0,0 +1,8 @@ +cite 'about-alias' +about-alias 'todo.txt-cli abbreviations' + +alias tls="$TODO ls" +alias ta="$TODO a" +alias trm="$TODO rm" +alias tdo="$TODO do" +alias tpri="$TODO pri" diff --git a/.bash_it/aliases/available/uuidgen.aliases.bash b/.bash_it/aliases/available/uuidgen.aliases.bash new file mode 100644 index 0000000..aada05f --- /dev/null +++ b/.bash_it/aliases/available/uuidgen.aliases.bash @@ -0,0 +1,11 @@ +cite 'uuid-alias' +about-alias 'uuidgen aliases' + +if _command_exists uuid; then # Linux + alias uuidu="uuid | tr '[:lower:]' '[:upper:]'" + alias uuidl=uuid +elif _command_exists uuidgen; then # macOS/BSD + alias uuidu="uuidgen" + alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING + alias uuidl=uuid +fi diff --git a/.bash_it/aliases/available/vagrant.aliases.bash b/.bash_it/aliases/available/vagrant.aliases.bash new file mode 100644 index 0000000..d479fb2 --- /dev/null +++ b/.bash_it/aliases/available/vagrant.aliases.bash @@ -0,0 +1,22 @@ +cite 'about-alias' +about-alias 'vagrant aliases' + +# Aliases +alias vhl='vagrant hosts list' +alias vscp='vagrant scp' +alias vsl='vagrant snapshot list' +alias vst='vagrant snapshot take' +alias vup="vagrant up" +alias vupl="vagrant up 2>&1 | tee vagrant.log" +alias vh="vagrant halt" +alias vs="vagrant suspend" +alias vr="vagrant resume" +alias vrl="vagrant reload" +alias vssh="vagrant ssh" +alias vst="vagrant status" +alias vp="vagrant provision" +alias vdstr="vagrant destroy" +# requires vagrant-list plugin +alias vl="vagrant list" +# requires vagrant-hostmanager plugin +alias vhst="vagrant hostmanager" diff --git a/.bash_it/aliases/available/vault.aliases.bash b/.bash_it/aliases/available/vault.aliases.bash new file mode 100644 index 0000000..d2ad8e7 --- /dev/null +++ b/.bash_it/aliases/available/vault.aliases.bash @@ -0,0 +1,15 @@ +cite 'about-alias' +about-alias 'vault aliases' + +# Aliases +alias vad="vault delete" +alias val="vault list" +alias var="vault read" +alias varn="vault renew" +alias varv="vault revoke" +alias vasrv="vault server" +alias vas="vault status" +alias vav="vault version" +alias vaw="vault write" +alias vag="vault login -method=github" +alias varv="vault read -field=value" diff --git a/.bash_it/aliases/available/vim.aliases.bash b/.bash_it/aliases/available/vim.aliases.bash new file mode 100644 index 0000000..d19057d --- /dev/null +++ b/.bash_it/aliases/available/vim.aliases.bash @@ -0,0 +1,25 @@ +# shellcheck shell=bash +cite 'about-alias' +about-alias 'vim abbreviations' + +VIM=$(command -v vim) +GVIM=$(command -v gvim) +MVIM=$(command -v mvim) + +if [[ -n $VIM ]]; then + alias v='$VIM' + # open the vim help in fullscreen incorporated from + # https://stackoverflow.com/a/4687513 + alias vimh='${VIM} -c ":h | only"' +fi + +# open vim in new tab is taken from +# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek +case $OSTYPE in + darwin*) + [[ -n $MVIM ]] && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; } + ;; + *) + [[ -n $GVIM ]] && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; } + ;; +esac diff --git a/.bash_it/aliases/available/yarn.aliases.bash b/.bash_it/aliases/available/yarn.aliases.bash new file mode 100644 index 0000000..b50535b --- /dev/null +++ b/.bash_it/aliases/available/yarn.aliases.bash @@ -0,0 +1,26 @@ +cite 'about-alias' +about-alias 'yarn package manager aliases' + +# Aliases +alias ya='yarn' +alias yai='yarn init' +alias yaa='yarn add' +alias yaga='yarn global add' +alias yaad='yarn add --dev' +alias yau='yarn upgrade' +alias yarm='yarn remove' +alias yagrm='yarn global remove' +alias yaod='yarn outdated' +alias yapa='yarn pack' +alias yap='yarn publish' +alias yasu='yarn self-update' +alias yaru='yarn run' +alias yat='yarn test' +alias yas='yarn serve' +alias yacc='yarn cache clean' +alias yack='yarn check' +alias yals='yarn list' +alias yain='yarn info' +alias yali='yarn licenses ls' +alias yaloi='yarn login' +alias yaloo='yarn logout' diff --git a/.bash_it/bash_it.sh b/.bash_it/bash_it.sh new file mode 100755 index 0000000..cb50420 --- /dev/null +++ b/.bash_it/bash_it.sh @@ -0,0 +1,159 @@ +#!/usr/bin/env bash +# Initialize Bash It +BASH_IT_LOG_PREFIX="core: main: " + +# Only set $BASH_IT if it's not already set +if [ -z "$BASH_IT" ]; then + # Setting $BASH to maintain backwards compatibility + export BASH_IT=$BASH + BASH="$(bash -c 'echo $BASH')" + export BASH + BASH_IT_OLD_BASH_SETUP=true +fi + +# Load composure first, so we support function metadata +# shellcheck disable=SC1090 +source "${BASH_IT}"/vendor/github.com/erichs/composure/composure.sh + +# We need to load logging module first as well in order to be able to log +# shellcheck source=./lib/log.bash +source "${BASH_IT}/lib/log.bash" + +# We can only log it now +[ -z "$BASH_IT_OLD_BASH_SETUP" ] || _log_warning "BASH_IT variable not initialized, please upgrade your bash-it version and reinstall it!" + +# For backwards compatibility, look in old BASH_THEME location +if [ -z "$BASH_IT_THEME" ]; then + _log_warning "BASH_IT_THEME variable not initialized, please upgrade your bash-it version and reinstall it!" + export BASH_IT_THEME="$BASH_THEME" + unset BASH_THEME +fi + +# support 'plumbing' metadata +cite _about _param _example _group _author _version +cite about-alias about-plugin about-completion + +# libraries, but skip appearance (themes) for now +_log_debug "Loading libraries(except appearance)..." +LIB="${BASH_IT}/lib/*.bash" +APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash" +for _bash_it_config_file in $LIB; do + if [ "$_bash_it_config_file" != "$APPEARANCE_LIB" ]; then + filename=${_bash_it_config_file##*/} + filename=${filename%.bash} + BASH_IT_LOG_PREFIX="lib: ${filename}: " + _log_debug "Loading library file..." + # shellcheck disable=SC1090 + source "$_bash_it_config_file" + fi +done + +# Load vendors +BASH_IT_LOG_PREFIX="vendor: " +for _bash_it_vendor_init in "${BASH_IT}"/vendor/init.d/*.bash; do + _log_debug "Loading \"$(basename "${_bash_it_vendor_init}" .bash)\"..." + # shellcheck disable=SC1090 + source "${_bash_it_vendor_init}" +done +unset _bash_it_vendor_init + +BASH_IT_LOG_PREFIX="core: main: " +# Load the global "enabled" directory +# "family" param is empty so that files get sources in glob order +# shellcheck source=./scripts/reloader.bash +source "${BASH_IT}/scripts/reloader.bash" + +# Load enabled aliases, completion, plugins +for file_type in "aliases" "plugins" "completion"; do + # shellcheck source=./scripts/reloader.bash + source "${BASH_IT}/scripts/reloader.bash" "skip" "$file_type" +done + +# Load theme, if a theme was set +if [[ -n "${BASH_IT_THEME}" ]]; then + _log_debug "Loading \"${BASH_IT_THEME}\" theme..." + # Load colors and helpers first so they can be used in base theme + BASH_IT_LOG_PREFIX="themes: colors: " + # shellcheck source=./themes/colors.theme.bash + source "${BASH_IT}/themes/colors.theme.bash" + BASH_IT_LOG_PREFIX="themes: githelpers: " + # shellcheck source=./themes/githelpers.theme.bash + source "${BASH_IT}/themes/githelpers.theme.bash" + BASH_IT_LOG_PREFIX="themes: p4helpers: " + # shellcheck source=./themes/p4helpers.theme.bash + source "${BASH_IT}/themes/p4helpers.theme.bash" + BASH_IT_LOG_PREFIX="themes: command_duration: " + # shellcheck source=./themes/command_duration.theme.bash + source "${BASH_IT}/themes/command_duration.theme.bash" + BASH_IT_LOG_PREFIX="themes: base: " + # shellcheck source=./themes/base.theme.bash + source "${BASH_IT}/themes/base.theme.bash" + + BASH_IT_LOG_PREFIX="lib: appearance: " + # appearance (themes) now, after all dependencies + # shellcheck source=./lib/appearance.bash + source "$APPEARANCE_LIB" +fi + +BASH_IT_LOG_PREFIX="core: main: " +_log_debug "Loading custom aliases, completion, plugins..." +for file_type in "aliases" "completion" "plugins"; do + if [ -e "${BASH_IT}/${file_type}/custom.${file_type}.bash" ]; then + BASH_IT_LOG_PREFIX="${file_type}: custom: " + _log_debug "Loading component..." + # shellcheck disable=SC1090 + source "${BASH_IT}/${file_type}/custom.${file_type}.bash" + fi +done + +# Custom +BASH_IT_LOG_PREFIX="core: main: " +_log_debug "Loading general custom files..." +CUSTOM="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/*.bash ${BASH_IT_CUSTOM:=${BASH_IT}/custom}/**/*.bash" +for _bash_it_config_file in $CUSTOM; do + if [ -e "${_bash_it_config_file}" ]; then + filename=$(basename "${_bash_it_config_file}") + filename=${filename%*.bash} + BASH_IT_LOG_PREFIX="custom: $filename: " + _log_debug "Loading custom file..." + # shellcheck disable=SC1090 + source "$_bash_it_config_file" + fi +done + +unset _bash_it_config_file +if [[ $PROMPT ]]; then + export PS1="\[""$PROMPT""\]" +fi + +# Adding Support for other OSes +PREVIEW="less" + +if [ -s /usr/bin/gloobus-preview ]; then + PREVIEW="gloobus-preview" +elif [ -s /Applications/Preview.app ]; then + # shellcheck disable=SC2034 + PREVIEW="/Applications/Preview.app" +fi + +# Load all the Jekyll stuff + +if [ -e "$HOME/.jekyllconfig" ]; then + # shellcheck disable=SC1090 + . "$HOME/.jekyllconfig" +fi + +# BASH_IT_RELOAD_LEGACY is set. +if ! command -v reload &> /dev/null && [ -n "$BASH_IT_RELOAD_LEGACY" ]; then + case $OSTYPE in + darwin*) + alias reload='source ~/.bash_profile' + ;; + *) + alias reload='source ~/.bashrc' + ;; + esac +fi + +# Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040 +set +T diff --git a/.bash_it/clean_files.txt b/.bash_it/clean_files.txt new file mode 100644 index 0000000..592b1ec --- /dev/null +++ b/.bash_it/clean_files.txt @@ -0,0 +1,121 @@ +####################################################################### +# Allow-list of files to be lint-checked by CI +# +# Directory Support +# Directory references are allowed within the file, ie: +# +# themes/powerline +# +# All files under the referenced directory will be checked +# +# Checking Files Locally +# You can manually invoke the check via: +# +# lint_clean_files.sh +# + +# root directories +# +docs/ +hooks/ + +# root files +# +.gitattributes +bash_it.sh +clean_files.txt +install.sh +lint_clean_files.sh + +# aliases +# +aliases/available/dnf.aliases.bash +aliases/available/git.aliases.bash +aliases/available/vim.aliases.bash + +# completions +# +completion/available/apm.completion.bash +completion/available/awless.completion.bash +completion/available/brew.completion.bash +completion/available/cargo.completion.bash +completion/available/composer.completion.bash +completion/available/conda.completion.bash +completion/available/consul.completion.bash +completion/available/django.completion.bash +completion/available/dmidecode.completion.bash +completion/available/docker-machine.completion.bash +completion/available/docker.completion.bash +completion/available/gcloud.completion.bash +completion/available/gem.completion.bash +completion/available/github-cli.completion.bash +completion/available/go.completion.bash +completion/available/helm.completion.bash +completion/available/jboss5.completion.bash +completion/available/jboss7.completion.bash +completion/available/jungle.completion.bash +completion/available/knife.completion.bash +completion/available/kontena.completion.bash +completion/available/kubectl.completion.bash +completion/available/lerna.completion.bash +completion/available/minikube.completion.bash +completion/available/ngrok.completion.bash +completion/available/notify-send.completion.bash +completion/available/npm.completion.bash +completion/available/packer.completion.bash +completion/available/pip.completion.bash +completion/available/pip3.completion.bash +completion/available/pipenv.completion.bash +completion/available/pipx.completion.bash +completion/available/rustup.completion.bash +completion/available/sdkman.completion.bash +completion/available/vault.completion.bash +completion/available/vuejs.completion.bash +completion/available/wpscan.completion.bash + +# plugins +# +plugins/available/alias-completion.plugin.bash +plugins/available/basher.plugin.bash +plugins/available/cmd-returned-notify.plugin.bash +plugins/available/docker-machine.plugin.bash +plugins/available/git.plugin.bash +plugins/available/go.plugin.bash +plugins/available/goenv.plugin.bash +plugins/available/history-search.plugin.bash +plugins/available/history-substring-search.plugin.bash +plugins/available/history.plugin.bash +plugins/available/xterm.plugin.bash + +# tests +# +test/plugins/alias-completion.plugin.bats +test/test_helper.bash + +# themes +# +themes/90210 +themes/agnoster +themes/atomic +themes/axin +themes/bakke +themes/barbuk +themes/base.theme.bash +themes/binaryanomaly +themes/bira +themes/bobby +themes/bobby-python +themes/brainy +themes/brunton +themes/candy +themes/command_duration.theme.bash +themes/easy +themes/modern +themes/powerline +themes/pure +themes/purity + +# vendor init files +# +vendor/.gitattributes +vendor/init.d diff --git a/.bash_it/completion/available/aliases.completion.bash b/.bash_it/completion/available/aliases.completion.bash new file mode 100644 index 0000000..e69de29 diff --git a/.bash_it/completion/available/apm.completion.bash b/.bash_it/completion/available/apm.completion.bash new file mode 100644 index 0000000..c3dcfe4 --- /dev/null +++ b/.bash_it/completion/available/apm.completion.bash @@ -0,0 +1,4 @@ +# shellcheck shell=bash +about-completion "apm completion" +# shellcheck disable=SC1090 +source "${BASH_IT}"/vendor/github.com/vigo/apm-bash-completion/apm diff --git a/.bash_it/completion/available/awless.completion.bash b/.bash_it/completion/available/awless.completion.bash new file mode 100644 index 0000000..98a5d38 --- /dev/null +++ b/.bash_it/completion/available/awless.completion.bash @@ -0,0 +1,5 @@ +# shellcheck shell=bash +if _command_exists awless; then + # shellcheck disable=SC1090 + source <(awless completion bash) +fi diff --git a/.bash_it/completion/available/awscli.completion.bash b/.bash_it/completion/available/awscli.completion.bash new file mode 100644 index 0000000..530bdd2 --- /dev/null +++ b/.bash_it/completion/available/awscli.completion.bash @@ -0,0 +1 @@ +[[ -x "$(which aws_completer)" ]] && complete -C "$(which aws_completer)" aws diff --git a/.bash_it/completion/available/bash-it.completion.bash b/.bash_it/completion/available/bash-it.completion.bash new file mode 100644 index 0000000..4fdd72d --- /dev/null +++ b/.bash_it/completion/available/bash-it.completion.bash @@ -0,0 +1,140 @@ +#!/usr/bin/env bash + +_bash-it-comp-enable-disable() +{ + local enable_disable_args="alias completion plugin" + COMPREPLY=( $(compgen -W "${enable_disable_args}" -- ${cur}) ) +} + +_bash-it-comp-list-available-not-enabled() +{ + subdirectory="$1" + + local available_things + + available_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/available/*.bash" | sort -d`; + do + file_entity=$(basename $f) + + typeset enabled_component=$(command ls "${BASH_IT}/$subdirectory/enabled/"{[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$file_entity,$file_entity} 2>/dev/null | head -1) + typeset enabled_component_global=$(command ls "${BASH_IT}/enabled/"[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$file_entity 2>/dev/null | head -1) + + if [ -z "$enabled_component" ] && [ -z "$enabled_component_global" ] + then + basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g' + fi + done) + + COMPREPLY=( $(compgen -W "all ${available_things}" -- ${cur}) ) +} + +_bash-it-comp-list-enabled() +{ + local subdirectory="$1" + local suffix enabled_things + + suffix=$(echo "$subdirectory" | sed -e 's/plugins/plugin/g') + + enabled_things=$(for f in `sort -d <(compgen -G "${BASH_IT}/$subdirectory/enabled/*.${suffix}.bash") <(compgen -G "${BASH_IT}/enabled/*.${suffix}.bash")`; + do + basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g' | sed -e "s/^[0-9]*---//g" + done) + + COMPREPLY=( $(compgen -W "all ${enabled_things}" -- ${cur}) ) +} + +_bash-it-comp-list-available() +{ + subdirectory="$1" + + local enabled_things + + enabled_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/available/*.bash" | sort -d`; + do + basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g' + done) + + COMPREPLY=( $(compgen -W "${enabled_things}" -- ${cur}) ) +} + +_bash-it-comp() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + chose_opt="${COMP_WORDS[1]}" + file_type="${COMP_WORDS[2]}" + opts="disable enable help migrate reload restart doctor search show update version" + case "${chose_opt}" in + show) + local show_args="aliases completions plugins" + COMPREPLY=( $(compgen -W "${show_args}" -- ${cur}) ) + return 0 + ;; + help) + if [ x"${prev}" == x"aliases" ]; then + _bash-it-comp-list-available aliases + return 0 + else + local help_args="aliases completions migrate plugins update" + COMPREPLY=( $(compgen -W "${help_args}" -- ${cur}) ) + return 0 + fi + ;; + doctor) + local doctor_args="errors warnings all" + COMPREPLY=( $(compgen -W "${doctor_args}" -- ${cur}) ) + return 0 + ;; + update) + if [[ ${cur} == -* ]];then + local update_args="-s --silent" + else + local update_args="stable dev" + fi + COMPREPLY=( $(compgen -W "${update_args}" -- ${cur}) ) + return 0 + ;; + migrate | reload | search | version) + return 0 + ;; + enable | disable) + if [ x"${chose_opt}" == x"enable" ];then + suffix="available-not-enabled" + else + suffix="enabled" + fi + case "${file_type}" in + alias) + _bash-it-comp-list-${suffix} aliases + return 0 + ;; + plugin) + _bash-it-comp-list-${suffix} plugins + return 0 + ;; + completion) + _bash-it-comp-list-${suffix} completion + return 0 + ;; + *) + _bash-it-comp-enable-disable + return 0 + ;; + esac + ;; + esac + + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + + return 0 +} + +# Activate completion for bash-it and its common misspellings +complete -F _bash-it-comp bash-it +complete -F _bash-it-comp bash-ti +complete -F _bash-it-comp shit +complete -F _bash-it-comp bashit +complete -F _bash-it-comp batshit +complete -F _bash-it-comp bash_it diff --git a/.bash_it/completion/available/brew.completion.bash b/.bash_it/completion/available/brew.completion.bash new file mode 100644 index 0000000..91c288d --- /dev/null +++ b/.bash_it/completion/available/brew.completion.bash @@ -0,0 +1,32 @@ +# shellcheck shell=bash +cite "about-completion" +about-completion "brew completion" + +# Load late to make sure `system` completion loads first +# BASH_IT_LOAD_PRIORITY: 375 + +if [[ "$(uname -s)" != 'Darwin' ]]; then + _log_warning "unsupported operating system - only 'Darwin' is supported" + return 0 +fi + +# Make sure brew is installed +_command_exists brew || return 0 + +BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)} + +if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then + # shellcheck disable=1090 + source "$BREW_PREFIX"/etc/bash_completion.d/brew + +elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]]; then + # shellcheck disable=1090 + source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh + +elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]]; then + # For the git-clone based installation, see here for more info: + # https://github.com/Bash-it/bash-it/issues/1458 + # https://docs.brew.sh/Shell-Completion + # shellcheck disable=1090 + source "$BREW_PREFIX"/completions/bash/brew +fi diff --git a/.bash_it/completion/available/bundler.completion.bash b/.bash_it/completion/available/bundler.completion.bash new file mode 100644 index 0000000..663a26d --- /dev/null +++ b/.bash_it/completion/available/bundler.completion.bash @@ -0,0 +1,273 @@ +#! bash +# bash completion for the `bundle` command. +# +# Copyright (c) 2008 Daniel Luz + +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# To use, source this file on bash: +# . completion-bundle + +__bundle() { + local bundle_bin=("${_RUBY_COMMAND_PREFIX[@]}" "$1") + local cur prev + _get_comp_words_by_ref -n : cur prev + local bundle_command + local bundle_command_index + __bundle_get_command + COMPREPLY=() + + local options + if [[ $cur = -* && $bundle_command != exec ]]; then + options="-V --help --no-color --no-no-color --verbose --no-verbose" + case $bundle_command in + "") + options="$options --version";; + check) + options="$options --dry-run --gemfile --path -r --retry";; + clean) + options="$options --dry-run --force";; + config) + options="$options --local --global --delete";; + doctor) + options="$options --gemfile --quiet --no-quiet";; + gem) + options="$options -b -e -t --bin --coc --no-coc --edit --exe + --no-exe --ext --no-ext --mit --no-mit --test";; + init) + options="$options --gemspec";; + install) + options="$options --binstubs --clean --deployment --force --frozen + --full-index --gemfile --jobs --local --no-cache + --no-prune --path --quiet --retry --shebang --standalone + --system --trust-policy --with --without";; + lock) + options="$options --add-platform --conservative --full-index + --local --lockfile --major --minor --patch --print + --remove-platform --strict --update";; + package) + options="$options --all --all-platforms";; + platform) + options="$options --ruby";; + show) + options="$options --outdated --paths --no-paths";; + update) + options="$options --bundler --conservative --force --full-index + --group --jobs --local --major --minor --patch --quiet + --ruby --source --strict";; + viz) + options="$options -f -F -R -v -W --file --format --requirements + --no-requirements --version --no-version --without";; + esac + else + case $bundle_command in + "" | help) + options="help install update package exec config + check show outdated console open lock viz init gem + platform clean doctor" + ;; + check | install) + case $prev in + --binstubs | --path) + _filedir -d + return;; + --standalone | --with | --without) + __bundle_complete_groups + return;; + --trust-policy) + options="HighSecurity MediumSecurity LowSecurity + AlmostNoSecurity NoSecurity";; + esac + ;; + config) + case $prev in + config | --*) + case $cur in + local.*) + options=($(__bundle_exec_ruby 'puts Bundler.definition.specs.to_hash.keys')) + options=("${options[*]/#/local.}") + ;; + *) + options=(path frozen without bin gemfile ssl_ca_cert + ssl_client_cert cache_path disable_multisource + ignore_messages retry redirect timeout + force_ruby_platform specific_platform + disable_checksum_validation disable_version_check + allow_offline_install auto_install + cache_all_platforms cache_all clean console + disable_exec_load disable_local_branch_check + disable_shared_gems jobs major_deprecations + no_install no_prune only_update_to_newer_versions + plugins shebang silence_root_warning + ssl_verify_mode system_bindir user_agent) + # We want to suggest the options above as complete words, + # and also "local." and "mirror." as prefixes + # To achieve that, disable automatic space insertion, + # insert it manually, then add the non-spaced prefixes + compopt -o nospace + options=("${options[@]/%/ }") + # And add prefix suggestions + options+=(local. mirror.) + # Override $IFS for completion to work + local IFS=$'\n' + COMPREPLY=($(compgen -W '${options[@]}' -- "$cur")) + return + ;; + esac + ;; + path | local.*) + _filedir -d + return;; + esac + ;; + exec) + if [[ $COMP_CWORD -eq $bundle_command_index ]]; then + # Figure out Bundler's binaries dir + local bundler_bin=$(__bundle_exec_ruby 'puts Bundler.bundle_path + "bin"') + if [[ -d $bundler_bin ]]; then + local binaries=("$bundler_bin"/*) + # If there are binaries, strip directory name and use them + [[ -f "$binaries" ]] && options="${binaries[@]##*/}" + else + # No binaries found; use full command completion + COMPREPLY=($(compgen -c -- "$cur")) + return + fi + else + local _RUBY_COMMAND_PREFIX=("${bundle_bin[@]}" exec) + _command_offset $bundle_command_index + return + fi + ;; + gem) + case $prev in + -e | --edit) + COMPREPLY=($(compgen -c -- "$cur")) + return;; + -t | --test) + options="minitest rspec";; + esac + ;; + update) + case $prev in + --group) + __bundle_complete_groups + return;; + *) + options=($(__bundle_exec_ruby 'puts Bundler.definition.specs.to_hash.keys')) + esac + ;; + viz) + case $prev in + -F | --format) + options="dot jpg png svg";; + -W | --without) + __bundle_complete_groups + return;; + esac + ;; + esac + fi + COMPREPLY=($(compgen -W "${options[*]}" -- "$cur")) +} + +__bundle_get_command() { + local i + for ((i=1; i < $COMP_CWORD; ++i)); do + local arg=${COMP_WORDS[$i]} + + case $arg in + [^-]*) + bundle_command=$arg + bundle_command_index=$((i + 1)) + return;; + --version) + # Command-killer + bundle_command=- + return;; + --help) + bundle_command=help + bundle_command_index=$((i + 1)) + return;; + esac + done +} + +# Provides completion for Bundler group names. +# +# Multiple groups can be entered, separated either by spaces or by colons. +# Input is read from $cur, and the result is directly written to $COMPREPLY. +__bundle_complete_groups() { + # Group being currently written + local cur_group=${cur##*[ :]} + # All groups written before + local prefix=${cur%"$cur_group"} + local groups=$(__bundle_exec_ruby 'puts Bundler.definition.dependencies.map(&:groups).reduce(:|).map(&:to_s)') + if [[ ! $groups ]]; then + COMPREPLY=() + return + fi + # Duplicate "default" and anything already in $prefix, so that `uniq` + # strips it; groups may be separated by ':', ' ', or '\ ' + local excluded=$'\ndefault\n'${prefix//[: \'\"\\]/$'\n'} + # Include them twice to ensure they are duplicates + groups=$groups$excluded$excluded + COMPREPLY=($(compgen -W "$(sort <<<"$groups" | uniq -u)" -- "$cur_group")) + # Prepend prefix to all entries + COMPREPLY=("${COMPREPLY[@]/#/$prefix}") + __ltrim_colon_completions "$cur" +} + +# __bundle_exec_ruby