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
#!/bin/bash | |
# Update Deja Dup Backup Exclude Config for the node_modules folders. | |
# This will only auto exclude if a package.json file and a .git folder exist. | |
# This also will update the list for excluding backups of vendor <composer> folders. | |
if [[ ! -x "$(command -v yq)" ]]; then | |
echo "'yq' is required. Please install 'yq'. Try 'snap install yq'" | |
exit 1; | |
fi |
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
semantic-commit = "!f() { \ | |
if [ \"$3\" != \"\" ]; then \ | |
git commit -S -m \"$1($2): $3\"; \ | |
else \ | |
git commit -S -m \"$1: $2\"; \ | |
fi \ | |
}; f" | |
chore = semantic-commit chore |
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
# ref: https://github.com/prasmussen/gdrive | |
# prerequisite: | |
# In google drive, setup your folder for storing the backups | |
# Then grab the code from the url e.g. https://drive.google.com/drive/folders/xxxxx where xxxxx is the code | |
# This code will be used later in the cron command, keep it secret, keep it safe | |
# install gdrive sync for backups | |
wget https://drive.google.com/uc?id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA -O /usr/local/bin/gdrive | |
chmod 755 /usr/local/bin/gdrive |
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
EVAL "for i, name in ipairs(redis.call('KEYS', 'author_*')) do redis.call('expire', name, 0); end" 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
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious |
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
<?php | |
function progress_bar($done, $total, $info="", $width=50) { | |
$perc = round(($done * 100) / $total); | |
$bar = round(($width * $perc) / 100); | |
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info); | |
} |