Last active
January 5, 2024 09:06
-
-
Save LukasBombach/00662c40faaaa0d2cc46ed5f759549a9 to your computer and use it in GitHub Desktop.
Revisions
-
LukasBombach revised this gist
Jan 5, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,8 +41,8 @@ function run() { echo "\n\033[92m➜\033[0m yarn $command\n" yarn "$command" elif [ -f "package-lock.json" ]; then echo "\n\033[92m➜\033[0m npm run $command\n" npm run "$command" else echo "No lock file found" fi -
LukasBombach revised this gist
Dec 19, 2023 . 1 changed file with 48 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,21 +25,57 @@ function killport() { echo "Port" $1 "found and killed." } # Run a command either by yarn or pnpm depending on the package manager in use # I am using yarn as a default because I like it more than npm function run() { local command="${1:-install}" if [ -f "bun.lockb" ]; then echo "\n\033[92m➜\033[0m bun $command\n" bun "$command" elif [ -f "pnpm-lock.yaml" ]; then echo "\n\033[92m➜\033[0m pnpm $command\n" pnpm "$command" elif [ -f "yarn.lock" ]; then echo "\n\033[92m➜\033[0m yarn $command\n" yarn "$command" elif [ -f "package-lock.json" ]; then echo "\n\033[92m➜\033[0m npm $command\n" npm "$command" else echo "No lock file found" fi } # Clears all caches on the system function clear_all_developer_caches() { echo "rm -rf ~/.cocoapods/" rm -rf ~/.cocoapods/ echo "pod cache clean --all" pod cache clean --all echo "yarn cache clean" yarn cache clean echo "All caches cleared." } function clear_node_and_next_etc() { echo "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +" find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + echo "find . -name '.next' -type d -prune -exec rm -rf '{}' +" find . -name '.next' -type d -prune -exec rm -rf '{}' + echo "find . -name '.expo' -type d -prune -exec rm -rf '{}' +" find . -name '.expo' -type d -prune -exec rm -rf '{}' + echo "find . -name '.contentlayer' -type d -prune -exec rm -rf '{}' +" find . -name '.contentlayer' -type d -prune -exec rm -rf '{}' + echo "Cleared all those things" } # Merge main from the upstream to the current branch and push to origin -
LukasBombach revised this gist
Jan 9, 2023 . 1 changed file with 2 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,19 +6,17 @@ alias zshrc="code ~/.zshrc" alias pkg="code ./package.json" alias dev="run dev" alias build="run build" alias start="run start" alias grstf="git checkout upstream/main --" # Clone a repo into ~/Projects and open code function np() { if ! test -d "$HOME/Projects/$(basename "$1" .git)" ; then git clone "$1" "$HOME/Projects/$(basename "$1" .git)" fi code "$HOME/Projects/$(basename "$1" .git)" } # Kill processes at a given port -
LukasBombach revised this gist
Jan 6, 2023 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,11 @@ alias grstf="git checkout upstream/main --" # Clone a repo into ~/Projects and open code function np() { if ! test -d "$HOME/Projects/$(basename "$1" .git)" ; then git clone "$1" "$HOME/Projects/$(basename "$1" .git)" else code "$HOME/Projects/$(basename "$1" .git)" fi } # Kill processes at a given port -
LukasBombach revised this gist
Jan 5, 2023 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,15 @@ # Configure oh my zsh alias zshrc="code ~/.zshrc" alias pkg="code ./package.json" alias dev="run dev" alias build="run build" alias grstf="git checkout upstream/main --" # Clone a repo into ~/Projects and open code function np() { git clone "$1" "$HOME/Projects/$(basename "$1" .git)" && code "$HOME/Projects/$(basename "$1" .git)" -
LukasBombach revised this gist
Jan 5, 2023 . 1 changed file with 17 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,23 @@ function killport() { echo "Port" $1 "found and killed." } # Run a command either by yarn or pnpm depending on the package manager in use # I am using yarn as a default because I like it more than npm function run() { local command="${1:-install}" if test -f "yarn.lock"; then echo "\n> yarn $command\n" yarn $command elif test -f "pnpm-lock.yaml"; then echo "\n> pnpm $command\n" pnpm $command else echo "\n> yarn $command\n" yarn $command fi } # Merge main from the upstream to the current branch and push to origin function gmu() { echo "" @@ -31,23 +48,6 @@ function gmu() { echo "" } # nvm with automatic node version switch based on the .nvmrc of a directory export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -
LukasBombach revised this gist
Jan 5, 2023 . 1 changed file with 60 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,21 +3,71 @@ # Configure oh my zsh alias zshrc="code ~/.zshrc" # Clone a repo into ~/Projects and open code function np() { git clone "$1" "$HOME/Projects/$(basename "$1" .git)" && code "$HOME/Projects/$(basename "$1" .git)" } # Kill processes at a given port function killport() { lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9 echo "Port" $1 "found and killed." } # Merge main from the upstream to the current branch and push to origin function gmu() { echo "" echo "> git pull origin $(current_branch)" git pull origin $(current_branch) echo "" echo "> git fetch upstream" git fetch upstream echo "" echo "> git merge upstream/main --no-edit" git merge upstream/main --no-edit echo "" echo "> git push origin $(current_branch)" git push origin $(current_branch) echo "" } # Run a command either by yarn or pnpm depending on the package manager in use function run() { local command="${1:-install}" if test -f "yarn.lock"; then echo "\n> yarn $command\n" yarn $command elif test -f "pnpm-lock.yaml"; then echo "\n> pnpm $command\n" pnpm $command else # using yarn as a default because I like it more than npm echo "\n> yarn $command\n" yarn $command fi } # nvm with automatic node version switch based on the .nvmrc of a directory export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm autoload -U add-zsh-hook load-nvmrc() { local nvmrc_path="$(nvm_find_nvmrc)" if [ -n "$nvmrc_path" ]; then local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") if [ "$nvmrc_node_version" = "N/A" ]; then nvm install elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then nvm use fi elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then echo "Reverting to nvm default version" nvm use default fi } add-zsh-hook chpwd load-nvmrc load-nvmrc -
LukasBombach revised this gist
Oct 18, 2022 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,3 +13,11 @@ function killport() { function np() { git clone "$1" "$HOME/Projects/$(basename "$1" .git)" && code "$HOME/Projects/$(basename "$1" .git)" } # Merge main from the upstream to the current branch and push to origin function gmu() { echo "git fetch upstream" git fetch upstream echo "git merge upstream/main --no-edit && git push origin $(current_branch)" git merge upstream/main --no-edit && git push origin $(current_branch) } -
LukasBombach created this gist
Oct 18, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # My oh my zsh aliases and functions # Configure oh my zsh alias zshrc="code ~/.zshrc" # Kill a process at port x function killport() { lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9 echo "Port" $1 "found and killed." } # Clone a repo into ~/Projects and open code function np() { git clone "$1" "$HOME/Projects/$(basename "$1" .git)" && code "$HOME/Projects/$(basename "$1" .git)" }