Skip to content

Instantly share code, notes, and snippets.

@christo8989
Last active November 11, 2021 16:43
Show Gist options
  • Save christo8989/b402707a19fce6d283882f784c327254 to your computer and use it in GitHub Desktop.
Save christo8989/b402707a19fce6d283882f784c327254 to your computer and use it in GitHub Desktop.
Front End (Angular) developer .bash_profile file.
# https://stackoverflow.com/a/416931
# https://askubuntu.com/a/121075
# load bash_profile from a gist
reload() {
# Windows
# $user_path="$USERPROFILE"
# curl -o "$USERPROFILE/.bashrc_gist" -H "Cache-Control: no-cache" https://gist.githubusercontent.com/christo8989/b402707a19fce6d283882f784c327254/raw/.bashrc_gist
# source "$USERPROFILE/.bashrc_gist"
# Mac / Linux?
# https://stackoverflow.com/a/57734278
# user_path="~"
# source /dev/stdin <<<"$( curl -sS -H 'Cache-Control: no-cache' https://gist.githubusercontent.com/christo8989/b402707a19fce6d283882f784c327254/raw/.bashrc_gist )"
}
reload;
welcomemessage;
# BASH Shortcuts
tohistory() {
command="$1";
history -s $command;
$command;
}
# ng
alias nrs="npm run start"
alias lint="ng lint"
alias nrb="npm run build"
alias nrt="npm run test"
module() { tohistory "ng g m $1 --dry-run"; }
component() { tohistory "ng g c $1 --changeDetection=OnPush --skipTests --entryComponent=false --export=false --flat=false --prefix=app --dry-run"; }
# npm
alias install="npm install --no-save"
alias pinstall="npm i -P"
alias dinstall="npm i -D"
alias uninstall="npm uninstall"
alias audit="npm audit fix"
alias hail-mary="npm cache clear --force"
# git
pull() { [[ -z "$1" ]] && git pull || git pull origin "$1"; }
gpl() { [[ -z "$1" ]] && git pull || git pull origin "$1"; }
alias push="git push"
alias gph="git push"
alias branch="git checkout -b"
alias gbc="get checkout -b"
alias branches="git branch"
alias gb="git branch"
alias checkout="git checkout"
alias gco="git co"
clone() { tohistory "git clone https://github.com/christo8989/$1.git"; }
# test
alias welcomemessage="echo 'node:' $(node --version) '\ngit:' \"${$(git version):12:-1}\" '\n\nHello Chris! Welcome to the Matrix.\n'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment