Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# To be called by a GNU screen keybinding
screen_copybuffer_file="${HOME}/tmp/screen-copybuffer"
case "$OSTYPE" in
[Dd]arwin*)
pbcopy < "$screen_copybuffer_file"
#!/bin/tcsh -f
# For use by a terminal emulator as its startup script.
# Sets `DISPLAY' to `localhost:0.0' and launches/re-attaches `screen'.
echo ":0.0" > "$HOME/tmp/display"
switch ( "$OSTYPE" )
case "darwin":
set SCREEN='/opt/local/bin/screen'
breaksw
default:
set SCREEN='/usr/bin/screen'
#!/usr/bin/env bash
# Did caller pass in an epoch time to compare?
if [ $# = 1 ]; then
"${HOME}/bin/test-host-times-match" "$1" || echo 'WARNING: Time out of sync' 1>&2
fi
# Primes the (possibly new) screen session with a (possibly new) remote DISPLAY
echo "${DISPLAY:-:10.0}" > "${HOME}/tmp/display"
;; An Org-mode capture template for scheduling a phone call to a BBDB contact.
;; Shortcut key: c
;; Target location: Under headline "Incoming" in file "~/org/ToDo.org".
;; Default tags: @phone
;; The function `ph/capture-bbdb' (see below) handles BBDB contacts with either a name or only an organization.
;;
;; To use this capture template, first mark the whole of the specific phone number you
;; want within the contact record in the *BBDB* buffer, then hit C-c t c.
;;
;; Prompts for:

The Economist has always been a staunch defender and exponent of the values of what the philosopher Karl Popper called the “open society”: a certain democratic pluralism, never carried too far of course; civil society; the rule of law; enduring non-state institutions; fulsome, open, public debate, though not about everything, which would obviously just be silly; checks, balances and accountability for state power, and perhaps to some lesser extent corporate power too; and its own special area of interest and expertise: a free, fearless, fair-ish and independent press, entitled to its own robustly expressed opinions and agendas, but with certain inviolable absolute obligations to inform the public honestly – more or less, within reason – and to uphold simple,

Debugger entered--Lisp error: (error "Capture abort: (wrong-type-argument stringp nil)")
signal(error ("Capture abort: (wrong-type-argument stringp nil)"))
error("Capture abort: %s" (wrong-type-argument stringp nil))
byte-code("\301\302!\203\nebugger entered--Lisp error: (error "Capture abort: (wrong-type-argument stringp nil)")
signal(error ("Capture abort: (wrong-type-argument stringp nil)"))
error("Capture abort: %s" (wrong-type-argument stringp nil))
byte-code("\301\302!\203\nebugger entered--Lisp error: (error "Capture abort: (wrong-type-argument stringp nil)")
signal(error ("Capture abort: (wrong-type-argument stringp nil)"))
error("Capture abort: %s" (wrong-type-argument stringp nil))
byte-code("\301\302!\203\nebugger entered--Lisp error: (error "Capture abort: (wrong-type-argument stringp nil)")
@PhilHudson
PhilHudson / active_user
Created June 17, 2016 15:15
Dual-screen interactive slideshow screensaver for MATE
#!/usr/bin/env bash
# Standard-repo requirements:
# w, awk, head, mktemp, split, grep, ck-list-sessions, sed, getent, cut
# TODO Check whether awk can't exit immediately after first match
ACTIVE_USER=`w --no-header -s | awk '/ :0 / {print $1}' | head -1`
[ -n "$ACTIVE_USER" ] && {
echo "$ACTIVE_USER"
exit 0
@PhilHudson
PhilHudson / vorbiscomment.el
Created July 27, 2016 08:50
Edit OGG Vorbis tag metadata in Emacs
;;; vorbiscomment.el --- Edit comments in Ogg Vorbis files
;; Copyright (C) 2003 Jesper Harder
;; Author: Jesper Harder <[email protected]>
;; Created: 19 Aug 2003
;; Version: 1.1
;; Location: <http://purl.org/harder/>
;; Keywords: multimedia, data
@PhilHudson
PhilHudson / shadow-file.el
Created August 30, 2019 21:32
shadow-file
;; Adapted from
;; http://muublog.blogspot.com/2018/01/for-various-reasons-i-needed-to-sync.html
(eval-and-compile
(require 'dash)) ; for `-lambda'
(defcustom ph/shadow-file-mappings nil
"Each key is the regular expression matching the file(s)
that should be copied, and the value is the target directory."
:group 'files
WARNING: Setting locale failed.
Check the following variables for correct values:
LC_ALL=en_GB.UTF-8
LANG=en_GB.UTF-8
Next version 1.3.4
<INFO> [21:28:37] next remote.lisp (initialize-instance :after remote-interface) -
D-Bus addresses: (#<Unix socket address: @"/tmp/dbus-cuENar4m4a">)
<INFO> [21:28:37] next remote.lisp (initialize-instance :after remote-interface) -
Bus connection name: :1.1
<INFO> [21:28:38] next port.lisp (run-program port) -