Skip to content

Instantly share code, notes, and snippets.

@timwright12
Last active September 19, 2025 20:56
Show Gist options
  • Save timwright12/469716e97c3fafab6688972247cf1771 to your computer and use it in GitHub Desktop.
Save timwright12/469716e97c3fafab6688972247cf1771 to your computer and use it in GitHub Desktop.
# PATH updates
export NVM_DIR=~/.nvm
export PATH="/usr/local/opt/ruby/bin:$PATH"
source $(brew --prefix nvm)/nvm.sh
# Terminal Alias
NEWLINE=$'\n'
ME=$'tim'
PROMPT="${NEWLINE}%B%F{white}%1~%f%b${NEWLINE}[%m][${ME}] -> "
# Homework Tests
alias check-es5='npx es-check es5 index.js'
# Command alias
alias edithosts='sudo vi /private/etc/hosts'
alias editbash='code ~/.zshrc'
alias phpserver='php -S localhost:8000'
alias pythonserver='python -m SimpleHTTPServer 8888'
alias npm-remove-packages='rm -rf node_modules/'
alias npm-reset-packages='rm -rf node_modules/ && yarn'
alias socksup='ssh socks -D 2001 -N &'
alias sockson='bash ~/Sites/va-gov/devops/utilities/va.sh socks on'
alias socksoff='bash ~/Sites/va-gov/devops/utilities/va.sh socks off'
alias socksadd='ssh-add -K ~/.ssh/id_rsa'
# Directory shortcuts
alias home='cd ~'
alias sites='cd ~/Sites'
alias desktop='cd ~/Desktop'
alias sandbox='cd ~/Sites/sandbox'
## Project alias
alias va='cd ~/Sites/va-gov/vets-website/ && git branch'
alias va-build-prod='NODE_ENV=production ./script/build.sh --buildtype vagovprod'
alias va-build-staging='NODE_ENV=production ./script/build.sh --buildtype vagovstaging'
alias va-build-dev='NODE_ENV=production ./script/build.sh --buildtype vagovdev'
alias va-reset='rm -rf node_modules/ && rm -rf .cache/ && rm -rf build/ && yarn && yarn build'
alias content-build='cd ~/Sites/va-gov/content-build/ && git branch'
alias devops='cd ~/Sites/va-gov/devops/ && git branch'
# Docker
alias dockerup='docker-compose up -d'
alias dockerdown='docker-compose down'
alias dockerstop='docker stop $(docker ps -a -q)'
alias dockerdelete='docker rm $(docker ps -a -q)'
alias dockerkill='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
# Composer
alias composer-install='composer install --ignore-platform-reqs'
alias composer-update='composer update --ignore-platform-reqs'
alias composer-dump='composer dump-autoload --ignore-platform-reqs'
# Adhoc website locally
# Commands:
# - adhoc go
# - adhoc build
# - adhoc serve
adhoc() {
if [[ "${1}" == "go" ]]
then
cd ~/Sites/adhoc/www.adhoc.team && git branch
elif [[ "${1}" == "build" ]]
then
bundle install && bundle exec jekyll build
elif [[ "${1}" == "serve" ]]
then
bundle exec jekyll serve
fi
}
server() {
python -m SimpleHTTPServer $1
}
# Usage: link /path/to/original /path/to/symlink
symlink() {
ln -s $1 $2
}
# Usage: remove path/to/dir
remove() {
rm -rf $1
}
## File diff
fs-diff() {
diff -ur $1 $2 | delta
}
# Directory diff
# Usage: src/site ../vets-website/src/site
fs-dir-diff() {
diff -rq $1 $2
}
# Usage: git-show-conflicts
git-show-conflicts() {
git diff --name-only --diff-filter=U
}
# USAGE: git-archive feature/branch-name
git-archive() {
git checkout $1
git tag archive/$1
git push origin archive/$1
git checkout master
git branch -D $1
git push origin :$1
}
# USAGE: git-upstream-set {{repo url}}
git-upstream-set() {
git remote add upstream $1
git fetch upstream
}
# USAGE: git-pull-fork 54 feature/whatever
git-pull-fork() {
git fetch origin pull/$1/head:$2
}
# From vets-website
# Usage: get-patch 8394a595db5ceb3c50a69c82b005377aa3fef82e
get-patch(){
git format-patch -1 $1
}
# From content-build
# Usage: apply-patch 0001-Pw-16192-fix-15045.patch include src/site/components/up_to_top_button.html
apply-patch() {
if [ "$2" ]
then
git am --signoff --$2 $3 < ../vets-website/$1
else
git am --signoff < ../vets-website/$1
fi
}
## NEW
# PATH updates
export NVM_DIR=~/.nvm
export PATH="/usr/local/opt/ruby/bin:$PATH"
source $(brew --prefix nvm)/nvm.sh
# source /usr/local/share/chruby/chruby.sh
# source /usr/local/share/chruby/auto.sh
source /opt/homebrew/opt/chruby/share/chruby/chruby.sh
source /opt/homebrew/opt/chruby/share/chruby/auto.sh
# Terminal Alias
NEWLINE=$'\n'
ME=$'tim'
PROMPT="${NEWLINE}%B%F{white}%1~%f%b${NEWLINE}[%m][${ME}] -> "
# Command alias
alias edithosts='sudo vi /private/etc/hosts'
alias editbash='code ~/.zshrc'
alias phpserver='php -S localhost:8000'
alias pythonserver='python -m SimpleHTTPServer 8888'
alias npm-remove-packages='rm -rf node_modules/'
alias npm-reset-packages='rm -rf node_modules/ && yarn'
alias socksup='ssh socks -D 2001 -N &'
alias sockson='bash ~/Sites/va-gov/devops/utilities/va.sh socks on'
alias socksoff='bash ~/Sites/va-gov/devops/utilities/va.sh socks off'
alias socksadd='ssh-add -K ~/.ssh/id_rsa'
alias start-vets-api='cd ~/Sites/va-gov/vets-api && bin/setup native && foreman start -m all=1,clamd=0,freshclam=0';
# Directory shortcuts
alias home='cd ~'
alias sites='cd ~/Sites'
alias desktop='cd ~/Desktop'
alias sandbox='cd ~/Sites/sandbox'
## Project alias
alias va='cd ~/Sites/va-gov/va-mobile-app/ && cd VAMobile && nvm use && git branch'
alias api='cd ~/Sites/va-gov/vets-api/ && git branch'
alias va-build-prod='NODE_ENV=production ./script/build.sh --buildtype vagovprod'
alias va-build-staging='NODE_ENV=production ./script/build.sh --buildtype vagovstaging'
alias va-build-dev='NODE_ENV=production ./script/build.sh --buildtype vagovdev'
alias va-reset='rm -rf node_modules/ && rm -rf .cache/ && rm -rf build/ && yarn && yarn build'
alias content-build='cd ~/Sites/va-gov/content-build/ && git branch'
alias devops='cd ~/Sites/va-gov/devops/ && git branch'
# Docker
alias dockerup='docker-compose up -d'
alias dockerdown='docker-compose down'
alias dockerstop='docker stop $(docker ps -a -q)'
alias dockerdelete='docker rm $(docker ps -a -q)'
alias dockerkill='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
# Git
alias gb='git branch'
alias gs='git status'
alias gp='git pull'
# Usage: createrelease v2.45.0
# https://department-of-veterans-affairs.github.io/va-mobile-app/docs/Engineering/DevOps/Automation%20Code%20Docs/GitHub%20Actions/ReleaseIssues#re-releasing-a-failed-build
createrelease() {
git tag --delete $1
git push --delete origin $1
git checkout release/$1
git pull
git tag -a $1 -m $1
git push origin $1
}
server() {
python -m SimpleHTTPServer $1
}
# Usage: useruby 3.4.2
useruby() {
chruby $1
}
# Usage: symlink /path/to/original /path/to/symlink
symlink() {
ln -s $1 $2
}
# Usage: remove path/to/dir
remove() {
rm -rf $1
}
## File diff
fs-diff() {
diff -ur $1 $2 | delta
}
# Directory diff
# Usage: src/site ../vets-website/src/site
fs-dir-diff() {
diff -rq $1 $2
}
# Usage: git-show-conflicts
git-show-conflicts() {
git diff --name-only --diff-filter=U
}
# USAGE: git-archive feature/branch-name
git-archive() {
git checkout $1
git tag archive/$1
git push origin archive/$1
git checkout master
git branch -D $1
git push origin :$1
}
# USAGE: git-upstream-set {{repo url}}
git-upstream-set() {
git remote add upstream $1
git fetch upstream
}
# USAGE: git-pull-fork 54 feature/whatever
git-pull-fork() {
git fetch origin pull/$1/head:$2
}
# Need to add code into a release after it has been created (but not pushed to the stores)
# Usage: recreate-release RC-vX.XX.0-XXXXXX-XXXX vX.XX.X
# https://department-of-veterans-affairs.github.io/va-mobile-app/docs/Engineering/DevOps/AutomationCodeDocs/GitHubActions/ReleaseIssues#need-to-add-code-into-a-release-after-it-has-been-created-but-not-pushed-to-the-stores
recreate-release() {
# Do first: Add updated code into the release branch release/vX.X.X and push to github
git tag --delete $1
git push --delete origin $1
git checkout release/$2
git pull
git tag -a $1 -m $1
git push origin $1
}
# JAVA_HOME` variable pointing to the java installed above example
export JAVA_HOME=$(/usr/libexec/java_home -v 21.0.0)
# `NODE_OPTIONS` this is to manage the node memory space
export NODE_OPTIONS=--max_old_space_size=8192
# Android specific vars for the ANDROID_HOME, platform-tools and cmdline-tools
export ANDROID_SDK=/Users/tim/Library/Android/sdk
export ANDROID_HOME=$ANDROID_SDK
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
# The build of the app relies on a scripted creation of the .env
# file to run correctly. You will need to add the `APP_CLIENT_SECRET`
# var to work correctly:
export APP_CLIENT_SECRET='####'
# The app has a demo mode. To use demo mode the app reads the
# `DEMO_PASSWORD` var. You can set this to a blank password or
# assign any string to it
export DEMO_PASSWORD=''
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
# python3 to path
export PATH="/opt/homebrew/bin/python3:$PATH"
# Created by `pipx` on 2025-07-29 15:05:47
export PATH="$PATH:/Users/tim/.local/bin"
@timwright12
Copy link
Author

PATH updates

export NVM_DIR=~/.nvm
export PATH="/usr/local/opt/ruby/bin:$PATH"
source $(brew --prefix nvm)/nvm.sh

source /usr/local/share/chruby/chruby.sh

source /usr/local/share/chruby/auto.sh

source /opt/homebrew/opt/chruby/share/chruby/chruby.sh
source /opt/homebrew/opt/chruby/share/chruby/auto.sh

Terminal Alias

NEWLINE=$'\n'
ME=$'tim'
PROMPT="${NEWLINE}%B%F{white}%1~%f%b${NEWLINE}[%m][${ME}] -> "

Command alias

alias edithosts='sudo vi /private/etc/hosts'
alias editbash='code ~/.zshrc'
alias phpserver='php -S localhost:8000'
alias pythonserver='python -m SimpleHTTPServer 8888'
alias npm-remove-packages='rm -rf node_modules/'
alias npm-reset-packages='rm -rf node_modules/ && yarn'
alias socksup='ssh socks -D 2001 -N &'
alias sockson='bash ~/Sites/va-gov/devops/utilities/va.sh socks on'
alias socksoff='bash ~/Sites/va-gov/devops/utilities/va.sh socks off'
alias socksadd='ssh-add -K ~/.ssh/id_rsa'

alias start-vets-api='cd ~/Sites/va-gov/vets-api && bin/setup native && foreman start -m all=1,clamd=0,freshclam=0';

Directory shortcuts

alias home='cd ~'
alias sites='cd ~/Sites'
alias desktop='cd ~/Desktop'
alias sandbox='cd ~/Sites/sandbox'

Project alias

alias va='cd ~/Sites/va-gov/va-mobile-app/ && cd VAMobile && nvm use && git branch'
alias api='cd ~/Sites/va-gov/vets-api/ && git branch'
alias va-build-prod='NODE_ENV=production ./script/build.sh --buildtype vagovprod'
alias va-build-staging='NODE_ENV=production ./script/build.sh --buildtype vagovstaging'
alias va-build-dev='NODE_ENV=production ./script/build.sh --buildtype vagovdev'
alias va-reset='rm -rf node_modules/ && rm -rf .cache/ && rm -rf build/ && yarn && yarn build'
alias content-build='cd ~/Sites/va-gov/content-build/ && git branch'
alias devops='cd ~/Sites/va-gov/devops/ && git branch'

Docker

alias dockerup='docker-compose up -d'
alias dockerdown='docker-compose down'
alias dockerstop='docker stop $(docker ps -a -q)'
alias dockerdelete='docker rm $(docker ps -a -q)'
alias dockerkill='docker stop $(docker ps -a -q) &amp;&amp; docker rm $(docker ps -a -q)'

Git

alias gb='git branch'
alias gs='git status'
alias gp='git pull'

Usage: createrelease v2.45.0

https://department-of-veterans-affairs.github.io/va-mobile-app/docs/Engineering/DevOps/Automation%20Code%20Docs/GitHub%20Actions/ReleaseIssues#re-releasing-a-failed-build

createrelease() {
git tag --delete $1
git push --delete origin $1
git checkout release/$1
git pull
git tag -a $1 -m $1
git push origin $1
}

server() {
python -m SimpleHTTPServer $1
}

Usage: useruby 3.4.2

useruby() {
chruby $1
}

Usage: symlink /path/to/original /path/to/symlink

symlink() {
ln -s $1 $2
}

Usage: remove path/to/dir

remove() {
rm -rf $1
}

File diff

fs-diff() {
diff -ur $1 $2 | delta
}

Directory diff

Usage: src/site ../vets-website/src/site

fs-dir-diff() {
diff -rq $1 $2
}

Usage: git-show-conflicts

git-show-conflicts() {
git diff --name-only --diff-filter=U
}

USAGE: git-archive feature/branch-name

git-archive() {
git checkout $1
git tag archive/$1
git push origin archive/$1
git checkout master
git branch -D $1
git push origin :$1
}

USAGE: git-upstream-set {{repo url}}

git-upstream-set() {
git remote add upstream $1
git fetch upstream
}

USAGE: git-pull-fork 54 feature/whatever

git-pull-fork() {
git fetch origin pull/$1/head:$2
}

Need to add code into a release after it has been created (but not pushed to the stores)

Usage: recreate-release RC-vX.XX.0-XXXXXX-XXXX vX.XX.X

https://department-of-veterans-affairs.github.io/va-mobile-app/docs/Engineering/DevOps/AutomationCodeDocs/GitHubActions/ReleaseIssues#need-to-add-code-into-a-release-after-it-has-been-created-but-not-pushed-to-the-stores

recreate-release() {
# Do first: Add updated code into the release branch release/vX.X.X and push to github
git tag --delete $1
git push --delete origin $1
git checkout release/$2
git pull
git tag -a $1 -m $1
git push origin $1
}

JAVA_HOME` variable pointing to the java installed above example

export JAVA_HOME=$(/usr/libexec/java_home -v 21.0.0)

NODE_OPTIONS this is to manage the node memory space

export NODE_OPTIONS=--max_old_space_size=8192

Android specific vars for the ANDROID_HOME, platform-tools and cmdline-tools

export ANDROID_SDK=/Users/tim/Library/Android/sdk
export ANDROID_HOME=$ANDROID_SDK
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

The build of the app relies on a scripted creation of the .env

file to run correctly. You will need to add the APP_CLIENT_SECRET

var to work correctly:

export APP_CLIENT_SECRET='###'

The app has a demo mode. To use demo mode the app reads the

DEMO_PASSWORD var. You can set this to a blank password or

assign any string to it

export DEMO_PASSWORD=''
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"

Add RVM to PATH for scripting. Make sure this is the last PATH variable change.

export PATH="$PATH:$HOME/.rvm/bin"

python3 to path

export PATH="/opt/homebrew/bin/python3:$PATH"

Created by pipx on 2025-07-29 15:05:47

export PATH="$PATH:/Users/tim/.local/bin"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment