Skip to content

Instantly share code, notes, and snippets.

@krl
krl / gist:869356
Created March 14, 2011 15:55
notmuch copy custom header (hack)
(defun ks-notmuch-show-copy-entry-url ()
(interactive)
(let ((raw (shell-command-to-string
(concat notmuch-command
" show --format=raw "
(notmuch-show-get-message-id)))))
(if (string-match "X-Entry-URL: \\(.*\\)" raw)
(let ((url (match-string 1 raw)))
(kill-new url)
(message "Killed url: %s" url))
;; just redefine this to use ido-completing-read
(defun eudc-select (choices beg end)
(let ((replacement
(ido-completing-read "Multiple matches found; choose one: "
(mapcar 'list choices))))
(delete-region beg end)
(insert replacement)))
@krl
krl / ii away scriptlet
Created March 22, 2011 16:52
ii away scriptlet
#!/bin/bash
THRESHOLD=1000
TEMP_FILE=/tmp/.ii-is-away
let time=$(date +%s)-$(stat -c%X ~/.ii-active)
function sendall {
for server in ~/irc/*
do
@krl
krl / iiconnect
Created December 10, 2011 18:50
iiconnect va
#!/bin/bash
PIDFILE=~/irc/$1/.meta/ii.pid
CONNECTFILE=~/irc/$1/.meta/on_connect
echo $PIDFILE
if [ ! -d ~/irc/$1/ ]; then
mkdir ~/irc/$1;
fi