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 perl | |
| # Print the group of files modified within an hour of the most recently | |
| # modified file. | |
| use strict; | |
| use List::Util qw[min max]; | |
| use Getopt::Std; | |
| $Getopt::Std::STANDARD_HELP_VERSION = 1; | |
| sub HELP_MESSAGE { |
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 | |
| # groff-install-ttf converts a TrueType (ttf) or OpenType (otf) font to a | |
| # Printer Font ASCII (pfa) font and a groff font (ditroff) and installs them to | |
| # groff's site-font directory. | |
| # | |
| # Requires fontforge. | |
| # | |
| # You're the best, Peter Schaffter, but contrary to the verbose and | |
| # difficult-to-follow http://www.schaffter.ca/mom/momdoc/appendices.html#fonts, | |
| # the t42 file doesn't seem to be necessary, at least with recent versions of |
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
| // grabtest tries to reproduce an X11 bug where, when two keys grabbed using | |
| // XGrabKey are held down and then quickly released, the second KeyRelease | |
| // event never makes it to the event queue. | |
| // | |
| // make LDFLAGS=-lX11\ -lXtst grabtest | |
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <assert.h> | |
| #include <X11/Xlib.h> |
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 | |
| IFS=$'\t\n' | |
| set -eu | |
| set -o pipefail | |
| PASS_FILE=${PASS_FILE:-~/notes/numbers.md} | |
| PASS_CLIP_TIME=${PASS_CLIP_TIME:-30} | |
| not_found=2 | |
| no_password=3 |
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 ruby | |
| require 'text/format' | |
| class Entry | |
| attr_accessor :flighting, :body | |
| def initialize | |
| @body = [] | |
| 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
| #!/usr/bin/env python | |
| # Guess Tags From Filename, using python and mutagen. | |
| import mutagen | |
| from mutagen.easyid3 import EasyID3 | |
| import re | |
| import os.path | |
| import sys |
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
| keycode 232 = XF86MonBrightnessDown | |
| keycode 233 = XF86MonBrightnessUp | |
| keycode 121 = XF86AudioMute | |
| keycode 122 = XF86AudioRaiseVolume | |
| keycode 123 = XF86AudioLowerVolume | |
| keycode 173 = XF86AudioPrev | |
| keycode 172 = XF86AudioPlay | |
| keycode 171 = XF86AudioNext |
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 | |
| # Monitor a command's output for changes. | |
| set -eu | |
| usage="diffmon [-D] [-t INTERVAL] CMD ARGS... | |
| -t INTERVAL Interval to sleep between command executions | |
| -b Print a blank line between changes instead of the date" | |
| interval=1 | |
| show_date=yes | |
| while getopts "hbt:" o; do | |
| case "$o" in |
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
| class VimFormatter | |
| RSpec::Core::Formatters.register self, :example_failed, :example_passed, :dump_summary | |
| def initialize(output) | |
| @output = output | |
| end | |
| def example_passed(n) | |
| @output << "PASSED: " << n.example.description << "\n\n" | |
| 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
| #!/usr/bin/python | |
| # Recursively print files created before/at/after (-//+) some number of days | |
| # ago. This only works on Windows, which stores file "birthtime" in the | |
| # filesystem | |
| import sys | |
| import os | |
| from datetime import date, timedelta |