Skip to content

Instantly share code, notes, and snippets.

View cwarden's full-sized avatar

Christian G. Warden cwarden

View GitHub Profile

Keybase proof

I hereby claim:

  • I am cwarden on github.
  • I am cwarden (https://keybase.io/cwarden) on keybase.
  • I have a public key whose fingerprint is CB1F D04D A7F8 4780 4C8D 1CE8 5D22 7839 4EF7 97A0

To claim this, I am signing this object:

@cwarden
cwarden / no-replies.sh
Created November 3, 2010 22:40
Find email messages with no replies
#!/bin/sh
# Directory which will contain symlinks to messages lacking replies
MFOLDER=~/.mairix-results
# default query - all messages from me
QUERY="f:$USER"
if [ "x$1" != "x" ]; then
QUERY="$@"
@cwarden
cwarden / new_followers.sh
Created November 30, 2010 19:15
New Twitter Followers
#!/bin/sh
twidge lsfollowers | sort > followers.new
diff -Nu followers.old followers.new | ifne mail -s "New Followers" cwarden@xerus.org
mv followers.new followers.old
@cwarden
cwarden / wyrd-newline-fix.patch
Created January 11, 2011 22:34
Fixes Debian bug #477084, appending newlines to new and pasted reminders
diff -ru wyrd-1.4.4/interface_main.ml wyrd-1.4.4-newline-fix/interface_main.ml
--- wyrd-1.4.4/interface_main.ml 2008-02-21 20:25:25.000000000 -0800
+++ wyrd-1.4.4-newline-fix/interface_main.ml 2011-01-11 14:28:36.000000000 -0800
@@ -626,7 +626,7 @@
let remfile_channel =
open_out_gen [Open_append; Open_creat; Open_text] 416 remfile
in
- output_string remfile_channel remline;
+ output_string remfile_channel (remline ^ "\n");
close_out remfile_channel;
@cwarden
cwarden / gist:784881
Created January 18, 2011 18:17
set IFS to newline
(IFS=$(echo -e "\n\r"); for i in $(ls -1 *.); do ...; done)
@cwarden
cwarden / .forward
Created January 26, 2011 17:56
Groupon Spa Filter
# Exim filter
if $header_from: matches "(mail@e.groupon.com|deals@livingsocial.com)" and $header_subject matches "(Treatments?|Facials?|Massages?|Pampering|Spas?|Salon)"
then
seen finish
endif
Words Source Result
pestology Gomel cheap 0
cocreating cheap 1
munitioner impersonating nonextinct cheap 1
Kolomna expensive 1
Enyo's snakemouth expensive 0
blueberries backare farriers cheap 0
markets rafales cheap 0
abided Gomel expensive 0
gurjun Gomel expensive 0
@cwarden
cwarden / myURLdecode.R
Created March 18, 2011 23:54
version of URLdecode function that handles unencoded %
myURLdecode <- function(URL)
{
x <- charToRaw(URL)
pc <- charToRaw("%")
out <- raw(0L)
i <- 1L
len <- length(x)
while(i <= len) {
if(x[i] != pc || i + 2 > len) {
out <- c(out, x[i])
@cwarden
cwarden / gist:882159
Created March 22, 2011 21:52
access iframe window in chrome
$('iframe-id').contentWindow
$i = $('itarget').contentWindow.$
@cwarden
cwarden / gist:966743
Created May 11, 2011 15:59
track list of twitter followers in git
13 8 * * * bash -c "(mkdir -p /home/cwarden/twitter; cd /home/cwarden/twitter; git init -q; twidge lsfollowers 2> >(egrep -v 'Bad response: (0|400)' >&2) | sort > followers; git diff followers | ifne mail -s 'New Followers' cwarden@xerus.org; test -z \"\$(git status --porcelain -z followers)\" || (git add followers; git commit -q -m'updated followers' followers ))"