Skip to content

Instantly share code, notes, and snippets.

View GrayedFox's full-sized avatar
👣
Maken tracks, one step at a time.

Che Fisher GrayedFox

👣
Maken tracks, one step at a time.
View GitHub Profile
@GrayedFox
GrayedFox / git-glean
Last active April 26, 2024 08:40
Remove local branches with a missing (gone) upstream
#!/usr/bin/env bash
# first we prune origin to ensure our local list of remote branches is up to date
git remote prune origin
GONE_BRANCHES=$(git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}')
if [ -z "$GONE_BRANCHES" ]; then
echo "Could not find any local branches that have a gone remote"
exit 0
@GrayedFox
GrayedFox / goodMorning
Last active September 26, 2023 01:47
Daily tasks that should be run every morning. Colour codes output for readability; can also fetch latest changes and tries to automatically rebase active branches.
#!/usr/bin/env bash
isNumber() {
( printf "%f" $1 >/dev/null 2>&1 ) \
&& echo "true" \
|| echo "false"
}
log() {
GREEN='\033[0;32m'
@GrayedFox
GrayedFox / foxy-ubuntu.sh
Last active September 25, 2023 07:10
Foxy Ubuntu
#!/usr/bin/env bash
source $HOME/.bashrc
MACHINE=$(uname -s)
cd $HOME
if [ "$MACHINE" == "Linux" ]; then
printf "Removing libreoffice, thunderbird, and webbrowser app..."