Skip to content

Commit

Permalink
4/26/2024
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm committed Apr 26, 2024
1 parent e3de2f6 commit bb7ddbc
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 25 deletions.
42 changes: 19 additions & 23 deletions .20_git.bash
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .20_kubernetes.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions .20_terraform.bash
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 *****
Expand All @@ -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 *****

Expand All @@ -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
Expand Down

0 comments on commit bb7ddbc

Please sign in to comment.