diff --git a/.20_git.bash b/.20_git.bash old mode 100644 new mode 100755 index 554d944..e731646 --- a/.20_git.bash +++ b/.20_git.bash @@ -40,6 +40,22 @@ __git_funcs() { git commit --allow-empty --message='Empty commit' } + grebase() { + git pull + + local stash_name + stash_name="$(cat /dev/urandom | base32 | tr -dc 'A-Z0-9' | head -c 16)" + git stash push --message "${stash_name}" || return 1 + if [[ $(git branch --list main) ]]; then + git fetch origin main:main + git rebase origin/main + else + git fetch origin master:master + git rebase origin/master + fi + git stash apply "stash^{/${stash_name}}" + } + gssh() { local origin_old origin_old="$(git remote get-url origin)" @@ -54,35 +70,15 @@ __git_funcs() { } gupdate() { - # git stash --include-untracked - - # git pull --rebase=merges - - # local git_branch - # git_branch=$(git branch --show-current) - # if [[ $(git branch --list main) ]]; then - # git checkout main - # else - # git checkout master - # fi - # git pull - # git checkout "${git_branch}" + git pull if [[ $(git branch --list main) ]]; then - git fetch origin main + git fetch origin main:main git merge --no-edit origin/main else - git fetch origin master + git fetch origin master:master git merge --no-edit origin/master fi - - # if [[ $(git branch --list main) ]]; then - # git checkout origin/main - # else - # git checkout origin/master - # fi - - # git stash pop } # Get the most recent versions from Git tags diff --git a/.20_kubernetes.bash b/.20_kubernetes.bash index e4d645a..786d730 100755 --- a/.20_kubernetes.bash +++ b/.20_kubernetes.bash @@ -52,6 +52,13 @@ __kube_completions() { __kube_completions +__kube_minikube() { + alias kminikube="minikube update-context" + alias kmini=kminikube +} +__kube_minikube + + __kube_funcs() { # Execute `bash` interactively in the Kubernetes pod # @param {string} $1 App label diff --git a/.20_pulsar.bash b/.20_pulsar.bash old mode 100644 new mode 100755 diff --git a/.20_python.bash b/.20_python.bash old mode 100644 new mode 100755 diff --git a/.20_temporal.bash b/.20_temporal.bash old mode 100644 new mode 100755 diff --git a/.20_terraform.bash b/.20_terraform.bash new file mode 100755 index 0000000..cc92b7f --- /dev/null +++ b/.20_terraform.bash @@ -0,0 +1,34 @@ +__terraform_install() { + if [[ -x "$(command -v terraform)" ]]; then + return 0 + fi + # Lazy install + terraform() { + if [[ -x "$(command -v brew)" ]]; then + brew tap hashicorp/tap + brew install hashicorp/tap/terraform + fi + unset -f "$0" + $0 "$@" + } +} +__terraform_install + + +__tflint_install() { + if [[ -x "$(command -v tflint)" ]]; then + return 0 + fi + # Lazy install + tflint() { + if [[ -x "$(command -v brew)" ]]; then + brew install tflint + elif [[ -x "$(command -v docker)" ]]; then + docker run --rm --volume "$(pwd):/data" --tty "ghcr.io/terraform-linters/tflint" "$@" + return $? + fi + unset -f "$0" + $0 "$@" + } +} +__tflint_install diff --git a/README.md b/README.md index 73dae2f..95048fd 100644 --- a/README.md +++ b/README.md @@ -44,4 +44,6 @@ Files are sourced in the following order: - [`.20_kubernetes.bash`](./.20_kubernetes.bash): [Kubernetes](https://kubernetes.io/) completions, shortcuts, and aliases - [`.20_nodejs.bash`](./.20_nodejs.bash): [Node.js](https://nodejs.org/en/) shortcuts and aliases - [`.20_pulsar.bash`](./.20_pulsar.bash): [Apache Pulsar](https://pulsar.apache.org/) shortcuts and aliases +- [`.20_python.bash`](./.20_python.bash): [Python](https://www.python.org/) shortcuts and aliases - [`.20_temporal.bash`](./.20_temporal.bash): [Temporal](https://docs.temporal.io/tctl-v1/) shortcuts and aliases +- [`.20_terraform.bash`](./.20_terraform.bash): [Terraform](https://www.terraform.io/) shortcuts and aliases diff --git a/settings.sh b/settings.sh index fe5261a..6b941b3 100755 --- a/settings.sh +++ b/settings.sh @@ -28,6 +28,8 @@ if [[ "${OSTYPE:-}" == "darwin"* ]]; then # ***** Settings > Notifications ***** # ***** Settings > Sound ***** + # Alert sound: Boop + defaults write .GlobalPreferences com.apple.sound.beep.sound -string "/System/Library/Sounds/Tink.aiff" # Alert volume defaults write .GlobalPreferences com.apple.sound.beep.volume -float 0.5 # Play feedback when volume is changed @@ -84,6 +86,8 @@ if [[ "${OSTYPE:-}" == "darwin"* ]]; then defaults write com.apple.dock autohide -bool false # Show indicators for open applications: true defaults write com.apple.dock show-process-indicators -bool true + # Click wallpaper to reveal desktop: always + defaults write com.apple.WindowManager EnableStandardClickToShowDesktop -int 1 killall Dock # ***** Settings > Displays ***** @@ -109,7 +113,7 @@ if [[ "${OSTYPE:-}" == "darwin"* ]]; then # Turn display off on power adapter when inctive for X minutes sudo pmset -c displaysleep 10 # TODO: Require password after screen saver begins or display is turned off: 1min - killall "System Settings" + killall "System Settings" || true # ***** Settings > Touch ID & Password ***** @@ -136,7 +140,8 @@ if [[ "${OSTYPE:-}" == "darwin"* ]]; then sudo defaults write /Library/Preferences/FeatureFlags/Domain/UIKit.plist redesigned_text_cursor -dict-add Enabled -bool YES # ***** Settings > Mouse ***** - defaults write .GlobalPreferences com.apple.mouse.scaling -1 + # Tracking speed + defaults write .GlobalPreferences com.apple.mouse.scaling 0.6875 # ***** Settings > Trackpad ***** # More gestures... app exposé: swipe down with three fingers