View termcolors.awk
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/awk -f | |
BEGIN { | |
# first the system ones: | |
print "System colors:" | |
for (color = 0; color < 8; color++) { | |
printf "\x1b[48;5;" color "m " | |
} | |
print "\x1b[0m" | |
for (color = 8; color < 16; color++) { | |
printf "\x1b[48;5;" color "m " |
View decisions.py
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 csv | |
import itertools | |
import sys | |
def main(): | |
reader = csv.reader(sys.stdin, delimiter='\t') | |
conditions = {} # ordered dict is assumed | |
for line in reader: | |
if not line: |
View clearSearchBar.uc.js
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
(function () { | |
function initSearchTextRemover () { | |
let searchbar = window.document.getElementById('searchbar'); | |
if (!searchbar) return; | |
patchSearchbar(searchbar); | |
} | |
function patchSearchbar (searchbar) { | |
if (searchbar.__patched__) return; | |
let origDoSearch = searchbar.doSearch; |
View dont_write_bytecode.txt
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
$ python -V | |
Python 3.7.0a2 | |
$ env PYTHONDONTWRITEBYTECODE=1 python -c 'import sys; print(sys.dont_write_bytecode)' | |
False |
View youtube-theater-720.css
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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("youtube.com") { | |
ytd-watch[theater] :not(.ytp-fullscreen)>.html5-video-container>.html5-main-video { | |
max-height: 720px; | |
} | |
ytd-watch[theater] #player.ytd-watch { | |
max-height: 720px; | |
} |
View thread-pool.rkt
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
#lang racket/base | |
(require racket/match | |
racket/async-channel | |
net/http-client) | |
(define urls '(["icanhazip.com" "/"] | |
["icanhazepoch.com" "/"] | |
["example.com" "/"])) |
View midi_to_key.py
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
NOTE_TO_KEY = { | |
36: Key.Q, | |
38: Key.W, | |
40: Key.E, | |
41: Key.R, | |
} | |
def update(midi): | |
data = midi.data |
View logmemavgload.fish
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
free -s 5 | stdbuf -o0 awk '/^Mem/ {mem = $3}; /buffers\/cache/ {buffers = $3}; /^Swap/ {swap = $3; print mem ";" buffers ";" swap}' > free.log & | |
fish -c 'while true; cat /proc/loadavg; sleep 5s; end' | stdbuf -o0 awk '{print $1}' > loadavg.log & | |
program | |
kill %1 %2 |
View st.js
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
/* global WScript */ | |
// Convert WScript.Arguments to Array | |
var wargs = WScript.Arguments; | |
var args = []; | |
var isPathRe = /^[A-Za-z]:\\.*/; | |
var driveRe = /^([A-Za-z]):/; | |
for (var i = 0; i < wargs.length; i++) { | |
var warg = wargs(i); | |
// Convert Windows path to POSIX path |
View uslt.py
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 argparse | |
import sys | |
from mutagen.id3 import USLT | |
from mutagen.mp3 import MP3 | |
def main(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('MP3FILE') |
NewerOlder