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
// 2017 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
repositories { | |
jcenter() | |
mavenCentral() | |
maven { url 'https://jitpack.io' } | |
maven { url 'https://maven.google.com' } | |
} | |
configurations { | |
deps | |
} |
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
import org.junit.Before; | |
import org.junit.Test; | |
import rx.Observable; | |
import rx.observers.TestSubscriber; | |
import rx.subjects.PublishSubject; | |
import rx.subjects.ReplaySubject; | |
import static org.junit.Assert.assertFalse; | |
import static org.junit.Assert.assertTrue; |
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
from gi.repository import Gtk | |
window = Gtk.Window() | |
window.connect('delete-event', Gtk.main_quit) | |
window.show() | |
Gtk.main() |
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 | |
# 2013 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
import os.path, sys, transmissionrpc | |
tc = transmissionrpc.Client() | |
for torrent in map(os.path.abspath, sys.argv[1:]) : | |
try : tc.add_torrent(torrent, download_dir = os.path.dirname(torrent)) | |
except : print ("Failed adding {0:s}".format(torrent)) |
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 | |
# 2013 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
if __name__ == '__main__' : | |
from time import sleep, time | |
start = time() | |
print ("Terminal Stop Watch") | |
try : | |
while True : sleep(.0001) | |
except : print ("\r{:f}".format(time() - start)) |
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/sh | |
# 2013 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
# Got a little annoyed by searching for game updates on HB webpage ... | |
[ $# -lt 2 ] && echo Usage: $(basename "$0") input-file output-dir && exit 1 | |
[ ! -f "$1" ] && ([ -t 0 ] || [ "$1" != - ]) && echo Invalid input-file \'$1\' && exit 1 | |
[ ! -d "$2" ] && ! mkdir -p "$2" && echo Invalid output-dir \'$2\' && exit 1 || out="$2" | |
bt=$(date +"%Y%m%d%H%M%S") && mkdir "$out/$bt" && bt="$bt/bt" | |
grep -m 1 'data-bt="' "$1" > /dev/null && S=\" || S=\' | |
grep -o "data-bt=$S.*://.*$S" "$1" | sed "s/^data-bt=\|$S//g" | sort | uniq > "$out/$bt" | |
[ x"$S" = x\" ] && sed -i "s/&/\&/g" "$out/$bt" |
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/sh | |
# 2014 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
IFS="$(printf '\n\t')" | |
[ -f .xpi-include ] && I="-d $(cat .xpi-include)" | |
[ -f .xpi-exclude ] && X=-x@.xpi-exclude | |
ls $I | zip -r "$(basename $(pwd)).xpi" -@ -x"*.xpi" $X |
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/sh | |
# 2014 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
# Create pdf from tex files. | |
[ $# -lt 1 ] && echo Usage: $0 tex-file && exit 1 | |
OUT=/tmp/pdflatex+out | |
[ -d $OUT ] || mkdir $OUT | |
PL="pdflatex -file-line-error -halt-on-error -output-directory $OUT" | |
for file in "$@" | |
do [ -f "$file" ] && $PL -draftmode "$file" && $PL "$file" | |
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
#!/bin/sh | |
# 2014 CC0 http://creativecommons.org/publicdomain/zero/1.0/ | |
# A little implementation of pause. | |
[ -t 0 ] || exit | |
[ $# -ge 1 ] && msg="$@" || msg="Press any key ..." | |
read -p "$msg" -n 1 c | |
[ x"$c" = x"" ] || echo -e "\b " |
NewerOlder