This file contains 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 characters
#!/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 |
This file contains 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 characters
#!/usr/bin/env bash | |
if [ $# -eq 1 ] ; then | |
NAME=$1 | |
else | |
echo "Please pass exactly one argument, which is the name of the patch file" | |
exit 1 | |
fi | |
git add . |
This file contains 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 characters
#!/usr/bin/env bash | |
BRANCH="main" | |
if [ $# -eq 1 ] ; then | |
BRANCH=$1 | |
fi | |
# count how many commits on your branch are not on the target branch, defaults to main | |
git rev-list HEAD --count ^$BRANCH |
This file contains 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 characters
#!/usr/bin/env bash | |
# if konsole is not open launch it | |
if [ -z "$(xdotool search --class konsole)" ]; then | |
konsole --tabs-from-file "/home/grayedfox/.config/konsole-tabs" | |
fi | |
# get current focused window and visible konsole window | |
CLASS="konsole" | |
KONSOLE_ID="$(xdotool search --class $CLASS | awk '{print $1}')" |
This file contains 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 characters
#!/usr/bin/env bash | |
isNumber() { | |
( printf "%f" $1 >/dev/null 2>&1 ) \ | |
&& echo "true" \ | |
|| echo "false" | |
} | |
log() { | |
GREEN='\033[0;32m' |
This file contains 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 characters
#!/usr/bin/env bash | |
source $HOME/.bashrc | |
MACHINE=$(uname -s) | |
cd $HOME | |
if [ "$MACHINE" == "Linux" ]; then | |
printf "Removing libreoffice, thunderbird, and webbrowser app..." |
This file contains 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 characters
#!/usr/bin/env python | |
# please ensure python means python3 on your system | |
# the file can be any binary file that contains a JPG image | |
# note that it's hungry and doesn't chunk the read so careful with large files | |
# usage: extract-jpg file_name | |
import sys |
This file contains 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 characters
# multiboot iso grub config | |
set timeout=15 | |
set default=0 | |
# (U)EFI Graphic Protocol | |
insmod efi_gop | |
insmod efi_uga | |
insmod font |
This file contains 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 characters
// remove the first instance of an item inside an array (extends native array object) | |
if (!Array.prototype.remove) { | |
Array.prototype.remove = function remove (item) { // eslint-disable-line no-extend-native | |
if (!(this || Array.isArray(this))) { | |
throw new TypeError() | |
} | |
if (this.indexOf(item) !== -1) { | |
this.splice(this.indexOf(item), 1) | |
return this |
This file contains 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 characters
#!/usr/bin/env bash | |
if [ $# -ne 1 ] ; then | |
echo "error: you must pass a single argument that is the file you wish to copy the contents of" | |
exit 1 | |
fi | |
FILE=$1 | |
xclip -selection clipboard < $FILE |
NewerOlder