Skip to content

Instantly share code, notes, and snippets.

@krl
krl / iiconnect
Created Dec 10, 2011
iiconnect va
View iiconnect
#!/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
@krl
krl / ii away scriptlet
Created Mar 22, 2011
ii away scriptlet
View 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
View emacs.el
;; 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 / gist:869356
Created Mar 14, 2011
notmuch copy custom header (hack)
View gist:869356
(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))