Skip to content

Instantly share code, notes, and snippets.

View bradfordcp's full-sized avatar

Christopher Bradford bradfordcp

View GitHub Profile
@bradfordcp
bradfordcp / xkcd_screensaver.rb
Created September 2, 2010 20:37
Generate a screensaver for your Nook with the contents of the current XKCD RSS feed
#!/usr/bin/ruby
#
# Generate a screensaver for your Nook with the contents of the current XKCD RSS feed
# http://xkcd.com/rss.xml
#
# Requirements:
# * Hpricot
# Optional:
# * RMagick
#
@bradfordcp
bradfordcp / Syns2Syms.java
Created September 2, 2010 19:12
Converts a WordNet prolog file into a flat file useful for Solr synonym matching.
/**
* Based off of the Lucene prolog parser in the wordnet contrib package within the
* main Lucene project. It has been modified to remove the Lucene bits and generate
* a synonyms.txt file suitable for consumption by Solr. The idea was mentioned in
* a sidebar of the book Solr 1.4 Enterprise Search Server by Eric Pugh.
*
* @see <a href="http://lucene.apache.org/java/2_3_2/lucene-sandbox/index.html#WordNet/Synonyms">Lucene Sandbox WordNet page</a>
* @see <a href="http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/contrib/wordnet/">SVN Repository of the WordNet contrib</a>
* @see <a href="https://www.packtpub.com/solr-1-4-enterprise-search-server/book">Solr 1.4 Enterprise Search Server Book</a>
*/
@bradfordcp
bradfordcp / Fortune Growler.rb
Created February 8, 2010 06:31
Fortune growler
#! /usr/bin/ruby
require 'rubygems'
require 'ruby-growl'
msg = `/opt/local/bin/fortune`
g = Growl.new('localhost', 'Fortune Growler', ['Fortune'], nil, "GrowlP4ss");
g.notify 'Fortune', 'Fortune Growler', msg