Skip to content

Instantly share code, notes, and snippets.

@brokaw
brokaw / acl-monitor.sh
Created September 21, 2011 21:55
Monitor the Last-Modified HTTP header on www.aclfestival.com. Designed for Mac OS X.
#!/bin/bash
# $1 = recipient
# $2 = The Subject
# $3 = The message content
sendapplemail() {
/usr/bin/osascript >/dev/null 2>&1 <<EOF
tell application "Mail"
set myContent to quoted form of "$3"
set theMessage to make new outgoing message with properties {subject:"$2", content:myContent, sender:"Steve Brokaw <steve@jetseven.org>"}
@brokaw
brokaw / count-change
Created September 20, 2011 15:48
count-change from SICP Chapter 1
(define (count-change amount)
(cc amount 5))
(define (cc amount kinds-of-coins)
(cond ((= amount 0) 1)
((or (< amount 0) (= kinds-of-coins 0)) 0)
(else (+ (cc amount
(- kinds-of-coins 1))
(cc (- amount
(first-denomination kinds-of-coins))
@brokaw
brokaw / post-commit
Created September 12, 2011 16:52
Jekyll Deployment on NFSN
TMP_CLONE_DIR=$(mktemp -d -t sitename)
git clone ${HOME}/site.git ${TMP_CLONE_DIR}
jekyll ${TMP_CLONE_DIR} ${DOCUMENT_ROOT}
rm -rf ${TMP_CLONE_DIR}
@brokaw
brokaw / gist:1136775
Created August 10, 2011 13:19 — forked from gruber/gist:1063605
Simple Inbox Archiving Script for Apple Mail
-- See article here: http://daringfireball.net/2007/07/simple_inbox_sweeper
-- The following should be one long line:
set _description to "All unflagged, read messages in each IMAP account
inbox will be moved to the “Archive” mailbox corresponding to that
account. This action is not undoable."
tell application "Mail"
display alert "Archive read messages from IMAP inboxes?" buttons ¬
{"Cancel", "Archive"} cancel button 1 message _description