Skip to content

Instantly share code, notes, and snippets.

hjst / abbreviations.tsv
Created Dec 14, 2016
Tab-delimited file of abbreviations used in the OED.
View abbreviations.tsv
abbr title
a. adjective
a. adoption of, adopted from
a (in dates) ante
abbrev. abbreviation (of)
Aberd. Aberdeen
abl. ablative
absol. absolute(ly)
abstr. abstract
Acad. academia, academy, academic(al)
hjst / pinniped.xml
Created Dec 13, 2016
Example of XDXF-formatted OED data
View pinniped.xml
<b>pinniped, <abr>a.</abr> <i>and</i> <abr>n.</abr></b>
<blockquote>(<c c="darkslategray">ˈpɪnɪpɛd</c>)</blockquote>
<blockquote>Also <b>pinnipede</b>, <b>pinnaped</b>.</blockquote>
hjst /
Created May 10, 2016
Configure my Dell monitor (EDID not auto-recognised) via VGA manually with xrandr
# This cvt command calculates the modeline for a 1920×1080 display @ 60Hz
modeline=`cvt 1920 1080 60 | tail -n 1 | cut -d ' ' -f 2-`
modeline_name=`echo ${modeline} | cut -d '"' -f 2`
if xrandr | grep ${modeline_name} > /dev/null; then
# Mode already exists (probably didn't reboot yet) so don't add it
echo "Monitor already configured, skipping..."
echo "Adding monitor config modeline from cvt output..."
hjst /
Created Jun 23, 2015
Makes reading stardict dictionary searches in a terminal more bearable.
# A wrapper script for sdcv which provides line spacing and wrapping to improve
# readability.
# Please note: sdcv(1) relies on dictionary files being in
# /usr/share/stardict/dic
# $(HOME)/.stardict/dic
usage() {
hjst /
Created Apr 18, 2015
This adds bash-history-esque !! and !$ bindings to fish shell (and the substitution is immediate, which is neat)
# put these in ~/.config/fish/functions/
function bind_bang
switch (commandline -t)
case "!"
commandline -t $history[1]
commandline -f repaint
case "*"
commandline -i !
hjst / gpg.rc
Last active Mar 30, 2021
Simple Mutt config for using GnuPG via GPGME
View gpg.rc
# Old-school GPG config was taken from the following docs. I'm preserving these
# links here just in case I need to configure an old version of mutt & gnupg in
# the future without gpgme.
# * /usr/share/docs/mutt/gpg.rc
# *
# *
# Mutt now has solid support for GPGME, which not only makes config much
# simpler and eliminates the need to fork gpg processes & parse their output -
# it also makes working with gpg-agent, kwallet, gnome-keyring etc. a doddle
hjst /
Last active Aug 29, 2015
Time ticker with variable line length for easy visual recognition of ssh session freezes
#!/usr/bin/env perl
use strict;
use warnings;
use Sys::Hostname;
require 'sys/';
sub main {
hjst /
Last active May 19, 2020
Generating SVG graphs from mtr reports
# Use a stacked column histogram
set style data histograms
set style histogram rowstacked
# Columns are 60% of max width (i.e. not touching, set 1.0 for touching)
set boxwidth 0.6
# Define colours - 1:yellow 2:orange 3:red
unset style line
set style line 1 linetype 1 linecolor rgb "#ffff99"
View Reading

These are books I've been recommended, books I own but haven't started yet, books I've been given but am avoiding reading etc. etc.


  • Flash Boys by Michael Lewis
  • The British Way in Counter-Insurgency, 1945-1967 by David French
  • The Library: A World History by James W. P. Campbell
  • Into That Darkness: An Examination of Conscience by Gitta Sereny
  • The Character of Physical Law by Richard Feynman
  • The Design and Implementation of the FreeBSD Operating System by Marshall Kirk McKusick, George Neville-Neil & Robert N. M. Watson
  • The Illustrated Star Wars Universe by Ralph McQuarrie & Kevin Anderson
hjst / feed-fixer.php
Created Sep 25, 2013
Pulls in an overstuffed RSS feed and removes any content:encoded nodes (which are usually superfluous).
View feed-fixer.php
$ch = curl_init("FEED URL GOES HERE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
curl_setopt($ch, CURLOPT_USERAGENT, "Henry's very friendly feed fetcher v1.1");
$rss_string = curl_exec($ch);
$dom = new DOMDocument();