Skip to content

Instantly share code, notes, and snippets.

View niallsmart's full-sized avatar

Niall Smart niallsmart

View GitHub Profile
@niallsmart
niallsmart / productivity.cron
Created February 20, 2011 18:34
Growl on on the half hour
# cronjob to get a Growl notification every half hour.
#
# Get growl & growlnotify from http://growl.info/ then
# install this cronjob using "crontab -e"
#
0,30 * * * * /usr/local/bin/growlnotify -m "The time is now `date +\%H:\%M`" -a "iCal"
@niallsmart
niallsmart / Craigslist extract
Created February 13, 2011 19:24
Simple JQuery snippet to extract Craigslist search results to CSV
$("p.row").each(function(index) {
var csv = $(this).text().trim().replace(/[ \r\n\t]+/g, ' ');
csv = csv.replace(/ pic$/, "\tpic")
csv = csv.replace(/ pic img$/, "\tpic img")
csv = csv.replace(/^([^-]*)- /, "$1\t")
csv = csv.replace(/ - ([($])/, "\t$1")
//csv = csv.replace(/(\$[0-9]+) ([^(])/, "$1\t\t$2")