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/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 " |
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
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: |
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 () { | |
function initSearchTextRemover () { | |
let searchbar = window.document.getElementById('searchbar'); | |
if (!searchbar) return; | |
patchSearchbar(searchbar); | |
} | |
function patchSearchbar (searchbar) { | |
if (searchbar.__patched__) return; | |
let origDoSearch = searchbar.doSearch; |
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
$ python -V | |
Python 3.7.0a2 | |
$ env PYTHONDONTWRITEBYTECODE=1 python -c 'import sys; print(sys.dont_write_bytecode)' | |
False |
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
@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; | |
} |
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
#lang racket/base | |
(require racket/match | |
racket/async-channel | |
net/http-client) | |
(define urls '(["icanhazip.com" "/"] | |
["icanhazepoch.com" "/"] | |
["example.com" "/"])) |
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
NOTE_TO_KEY = { | |
36: Key.Q, | |
38: Key.W, | |
40: Key.E, | |
41: Key.R, | |
} | |
def update(midi): | |
data = midi.data |
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
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 |
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
/* 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 |
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
import argparse | |
import sys | |
from mutagen.id3 import USLT | |
from mutagen.mp3 import MP3 | |
def main(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('MP3FILE') |
NewerOlder