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 characters
#!/usr/bin/env bash | |
session_pid() { | |
session=`pidof ck-launch-session` | |
echo `ps -o pid --no-headers --ppid $session` | |
} | |
environment() { | |
strings -a /proc/$1/environ | |
} |
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 characters
// ==UserScript== | |
// @name TYS Booking Google Calendar Integration | |
// @description Add Google Calendar Entries from TYS Booking (icons by famfamfam.com) | |
// @namespace tysbookinghelper | |
// @include http://booking.tys.fi/varaus/service/timetable/* | |
// @grant none | |
// ==/UserScript== | |
const DATE_PARSER = /(\d+)\.(\d+)\.(\d+) (\d+):(\d+) - (\d+):(\d+) (.+) -/; | |
const CALENDAR_ICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJlSURBVDjLpZNbaM9hGMc/v8NsTqF2yMhZKIexmpFyRZIiblwouZDauLYoTVEryg2uXIoIOUU5zJkh4e9QDmtJbWxrbUzz/72/9/m6+P3HLslbT9/3ufm+n/f7Pm8gif9ZMcDxe717JLZ62UQzwxukZnhveBOptyHl8anwZk/3b5pZEwOYtGNDzejSfzm58dTH+b8JvFkpwMizdSCBT8E8OJftkzy4BPIOnONHQzPO+eIhBoM5CCrLwNKslBZM8uDykCbwtgMAl/o/GXhvBYMA2rtAlpGYZSR+UIGKCgCSggGSOHy1Q/0DTifufZUknbr/RZJ0+mHWn3mU9edbMu3qG9DmQ08lKSNw3jCJOIKzjzqJopBzLZ3EEVx40smDr/u4e96QGUXPGpkzYQSJywjCwSsIiKOADUvKiUNYX1tOUQhra8oJg4hZ02cQhhGrqyuyp03tTwbOGzKIQ7j8rIsn3Qd4fEVIIn6+kzAM |
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 characters
function mount-latest | |
set disk (ls --sort=time /dev/disk/by-uuid | head -n1) | |
sudo mount -o gid=users,fmask=113,dmask=002 "/dev/disk/by-uuid/$disk" "$argv" | |
end |
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 characters
keysym 1 = exclam 1 | |
keysym 2 = quotedbl 2 at | |
keysym 3 = numbersign 3 sterling | |
keysym 4 = dollar 4 currency | |
keysym 5 = percent 5 | |
keysym 6 = ampersand 6 | |
keysym 7 = slash 7 braceleft | |
keysym 8 = parenleft 8 bracetleft | |
keysym 9 = parenright 9 bracetright | |
keysym 0 = equal 0 braceright |
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 characters
<Multi_key> <N> <b>: "#" U0023 | |
<Multi_key> <D> <O>: "$" U0024 | |
<Multi_key> <A> <t>: "@" U0040 | |
<Multi_key> <less> <parenleft>: "[" U005B | |
<Multi_key> <slash> <slash>: "\" U005C | |
<Multi_key> <parenright> <greater>: "]" U005D | |
<Multi_key> <apostrophe> <greater>: "^" U005E | |
<Multi_key> <apostrophe> <exclam>: "`" U0060 | |
<Multi_key> <parenleft> <exclam>: "{" U007B | |
<Multi_key> <exclam> <exclam>: "|" U007C |
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 characters
#!/usr/bin/env bash | |
podcast_dir=$HOME/podcasts | |
queue=$HOME/.local/share/newsbeuter/queue | |
queued=`cut -d " " -f 2 < $queue` | |
deleted="" | |
for file in $podcast_dir/*; do | |
protected=`echo "$queued" | grep -xF "\"$file\""` | |
if [ -z "$protected" ]; then |
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 characters
#!/usr/bin/env bash | |
# Tiny helper for managing and applying patches to ABS packages | |
# | |
# Example: | |
# Store patches for vim PKGBUILD in ~/patches/extra/vim/PKGBUILD | |
# and update abs, copy package files to ~/abs, apply patches and build package | |
# by running ./abs-update-patch.sh extra/vim | |
# | |
# Flags: | |
# -u disable updating abs |
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 characters
#!/usr/bin/env python3 | |
from os import listdir, stat, remove | |
from os.path import isfile, abspath | |
from itertools import groupby | |
from hashlib import md5 | |
from sys import argv | |
from operator import itemgetter | |
def get_files(path): | |
return list(filter(isfile, map(abspath, listdir(path)))) |
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 characters
#!/usr/bin/env python3 | |
import dbus | |
import subprocess | |
import sys | |
class InvalidCommand(Exception): | |
pass | |
class NoServiceAvailable(Exception): | |
pass |