Skip to content

Instantly share code, notes, and snippets.

View janmoesen's full-sized avatar

Jan Moesen janmoesen

View GitHub Profile
@janmoesen
janmoesen / twatspam.pl
Created April 19, 2012 21:03
Twatspam for Irssi: expand tweets in channels
# == WHAT
# Expand the tweets mentioned in a channel, as well as the tweets those tweets refer to.
#
# == WHO
# Jan Moesen, 2012
#
# == INSTALL
# Place these files in `~/.irssi/scripts/`.
# /script load twatspam.pl
@janmoesen
janmoesen / gist:1286835
Created October 14, 2011 11:13
Word of the day in Bash
# Read a random word from the dictionary and try to get its definition from
# Merriam-Webster.
function word-of-the-day {
local file="${1:-/usr/share/dict/words}";
if ! [ -r "$file" ]; then
echo "Cannot read from dictionary file: $file" 1>&2;
return 1;
fi;
local IFS=$'\n' words=($(<"$file"));
local num_words=${#words[@]};