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 | |
# | |
# This is sp, the command-line Spotify controller. It talks to a running | |
# instance of the Spotify Linux client over dbus, providing an interface not | |
# unlike mpc. | |
# | |
# Put differently, it allows you to control Spotify without leaving the comfort | |
# of your command line, and without a custom client or Premium subscription. | |
# |
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 | |
# For a vastly more feature-rich tool, have a look at | |
# https://gist.github.com/Ohcanep/48dac84c5916821d150c545a6eb12547 | |
# https://gist.github.com/wandernauta/6800547 (original) | |
DEST="org.mpris.MediaPlayer2.spotify" | |
OBJECT_PATH="/org/mpris/MediaPlayer2" | |
INTERFACE="org.mpris.MediaPlayer2.Player" |
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
[alias] | |
b = branch -vv | |
ba = branch -avv | |
c = commit | |
ca = commit --amend | |
can = !git commit --amend --date="$(date +%Y-%m-%dT%H:%M:%S%z)" | |
co = checkout | |
com = checkout master | |
ds = diff --stat-name-width=50 | |
dw = diff --word-diff=color |
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 | |
E_NUMARGS=1 | |
E_NOTDIR=2 | |
if [ $# -ne 1 ]; then | |
echo "Usage: `basename $0` [DIRECTORY]" | |
exit $E_NUMARGS | |
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
#!/usr/bin/env python3 | |
# curl -sS $KARINKEIKAT_BASE_URL/$(date +%Y)'.json?orderBy="date"&startAt="'$(date -I)'"&limitToFirst=5' | jq '.' | |
import json | |
import os | |
from sys import argv | |
import lxml.html | |
import requests |
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
## | |
## Serpent Guard / Jaffa | |
## | |
$the_cow = <<EOC; | |
$thoughts | |
$thoughts | |
$thoughts | |
___ | |
/ \\ | |
| @ \\ |
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 | |
git config --get-regexp 'alias.*' | colrm 1 6 | sort | while read -r line; do | |
alias_name=$(echo "$line" | cut -d ' ' -f 1) | |
alias_command=$(echo "$line" | cut -d ' ' -f 2-) | |
printf "\033[1;37m%16s \033[0;39m%s\n" "$alias_name" "$alias_command" | |
# color ^^^^^^^^^^ ^^^^^^^^^^ | |
# minimum width ^^ | |
done |
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 python3 | |
# https://docs.python.org/3/library/datetime.html | |
# https://docs.python.org/3/library/string.html#formatspec | |
from datetime import date, timedelta | |
def days_from_now(days: int) -> date: | |
return date.today() + timedelta(days=days) |