#

Don’t be so sure he’s the expert: “Not a single woman among all our female study subjects called herself an ‘expert’ user, while not a single male ranked himself as a complete novice or ‘not at all skilled.’”


#

Social timeline maker Dandelife is really cool but I’m anti-social, and anti-hosted data. Happily, with the open source, fancy pants SIMILE Timeline one can create and host their own timeline. Fabulous.


#

I had no idea one could write a bash completion script - that makes the Tab key fill in possible custom commands or arguments when you’re at a prompt - but one of my todo.txt developers did, and wrote one that completes todo.sh arguments or your existing projects, contexts or priorities. Which totally blew my doors off.


Customize your terminal prompt

July 16th, 2006 | Filed under Bash scripts, Code snippets

I’m probably going to be embarrassed about this post in the morning, but I re-figured out how to customize my terminal prompt, and I got something that I like which I’ll post here for the next time I get a new computer and have to Google the whole thing up again.

In ~/.bashrc (Mac: ~/.bash_profile), add:


function prompt
{
local GREEN="\[\033[0;32m\]”
local CYAN=”\[\033[0;36m\]”
local GRAY=”\[\033[0;37m\]”
local BLUE=”\[\033[0;34m\]”
export PS1=”${GREEN}\u${CYAN}@${BLUE}\h ${CYAN}\w${GRAY}
$ ”
}
prompt

Then:


$ source .bashrc

Which makes it look something like this:


gina@amelia ~/Documents
$

But with pretty colors.

That is all.


Diffutils - patching software with .diff files

July 15th, 2006 | Filed under Open source, Unix

Now that I’m running an open source project with a mailing list of developers much more skilled than I am, I’ve got folks emailing in code patches in the form of .diff files. Having never dealt with .diff’s before (I know, I know, Windows baby here) I dove into the GNU diffutils manual. This kind of stuff still scares the crap out of me, but:

$ patch todo.sh todocolour.diff

Applied the submitted file differences to the source code, and I was able to run my unit tests straightaway without hand-adding edited code line by line.

Patch added the changed lines to the original file (todo.sh) and created a todo.sh.orig file as well. If it fails on merging any file differences, it creates a todo.sh.rej file.

Simple, useful and handy.

Diffutils [GNU Project - Free Software Foundation (FSF)]

#

The Subclipse plugin for Eclipse is my preferred method for talking to my Subversion repository. Here’s a thorough tutorial on using Subversion with Eclipse.


#

veryplaintxt is a very nice WordPress theme.


#

Silk icons is a gorgeous - and big! - library of free icons.


AJAX homepage tutorial

June 26th, 2006 | Filed under AJAX, DHTML, Javascript, Tutorials

After reviewing about 17 dozen dynamic RSS reader homepages on Lifehacker (like Google’s Personalized Homepage and Netvibes and Protopage) - which are all basically the same - it warms my heart to see a tutorial on how to build your own.

Hopefully this means these “desktop” homepages have jumped the shark and everyone move their “WebOS” dev efforts onto something a bit more innovative (and useful!).

AJAX Desktop tutorial [MuseStorm]

Todo.txt, task tracking for command line lovers

June 25th, 2006 | Filed under Bash scripts, Open source, Screencasts

Awhile back I threw together a monster bash script, todo.sh, which reads and writes to a personal todo.txt file.

Using a bunch of sed and grep recipes for editing, adding, slicing and dicing by project, context and priority (ala Getting Things Done), this is the only todo manager I’ve ever stuck with for more than a month. Here’s a 3-minute or so screencast of how todo.sh works:

Note: I aliased todo.sh to t here to reduce typing strain.

The AIM bot I mentioned earlier executes todo.sh as well, so you can IM your todo.txt from the office or your phone. Imagine IM’ing your bot list @shopping to get your grocery shopping list on your phone from the aisle at Ralph’s.

Anyway, all the todo.txt script shenanigans I’ve been hacking together are now located at their very own domain, todotxt.com.

I’ve got a rant about the current state of organizational software and the wonderful experience of leading an open source project that’s garnered quite a few Lifehacker.com reader contributors, but that’ll be another post.

Todotxt.com

Banging out an AIM bot

June 25th, 2006 | Filed under Code snippets, Perl

I’m not a Perl developer by any means (Python’s my poison) but I wanted to build a quick AIM bot, and Perl’s OSCAR.pm lets you do it in less than 20 lines of code. It’s insane how simple this is:

use warnings;
use strict;
use Net::OSCAR qw(:standard);
my $oscar;
$oscar = Net::OSCAR->new();
$oscar->set_callback_im_in(&im_in);
$oscar->signon($screenname, $password);
while(1)
{
$oscar->do_one_loop();
}
sub im_in {
my($oscar, $sender, $message, $is_away) = @_;
print "[AWAY] ” if $is_away;
print “$sender: $message\n”;
$response = “Hello”;
$oscar->send_im($sender, $response);
}

I wrote a bot which executes a shell script that reads and writes to your todo.txt (more on that in a minute.) Mark ran with the idea and we discussed keeping a bot that can run other scripts on your computer, like “open VNC port” instead of using port knocking or leaving your server port open at all times. The trick is the bot only runs commands from authorized AIM names. I’m not sure how secure that is, but it is a neat idea.

Build Your Own AIM Answerbot [On LAMP]

Back from the dead

June 25th, 2006 | Filed under Announcements

My, my, it’s been some time. While I was away (working on a bunch of small and not-so-small writing projects) comment spammers took over the joint and WordPress got upped a few versions.

For tonight, a mass comment spam deletion, an upgrade to the latest version of WP, and a new theme.

I’ve been doing a bit of development here and there I’ll tell you all about in the morning.


ETech JavaScript tutorial

March 7th, 2006 | Filed under Javascript, Reference, Tutorials

I was really sad to miss Simon Willison’s Javascript tutorial at ETech this week, but happily he’s posted all his slides and detailed notes. Thanks, Simon! Definitely gonna brush up on the Javascript with this.

My ETech JavaScript tutorial [Simon Willison]

The human side of the web applications

February 24th, 2006 | Filed under Interface design

Frederico’s spot-on when he says that Flickr’s frequent error messages are a lot easier to deal with because they seem human:

How many times have you seen Flickr fail? I have seen it happen quite a few times, but something behind the “Flickr is having a massage” message, shown whenever someone tripped on a few cables, keeps me comfortable - it lets me know my photos and those of my friends, are in good hands. It will all be okay, even when something has clearly gone wrong.

I like Flickr’s (and I paraphrase), “Whoah Nelly, hold your clicks! The server’s running HOT right now!” error message which is WAY more effective than “HTTP 500 Internal Server Error.” Just goes to show a little editorial goes a long long way.

The human side of the web applications [WeBreakStuff]

FileChucker: AJAX File Upload Script with Progress Bar

February 24th, 2006 | Filed under AJAX, Perl

FileChucker’s a $15 Perl script that provides an Ajax-y file upload interface for your web site, complete with progress bar. Haven’t tried it, but looks pretty cool.

FileChucker: AJAX File Upload Script with Progress Bar [Encodable Industries]

AJAX Unit Testing

February 15th, 2006 | Filed under AJAX, Unit testing

The words “Ajax” and “Unit testing” spoken in the same how-to article make me all warm and tingly inside. If JSUnit is actually workable, I’ll have a lot less mental blockage around dev’ing Ajax functionality for sure.

AJAX and Unit Testing - it’s time to mingle [Jim Plush's Programming Paradise]

The Trendiest Web2.0 Page on the Net!

February 14th, 2006 | Filed under Design

There are some aspects of contemporary web (web2.0?) design which are duplicated across many sites…

TrendyWEB | The Trendiest Web2.0 Page on the Net!

Yahoo! UI Library

February 13th, 2006 | Filed under AJAX, DHTML, Javascript

The Yahoo! User Interface Library’s got a bunch of open source Ajaxy UI components, including a Calendar control, Drag and Drop, a Slider and Tree View. Neat.

Yahoo! UI Library

MovableType and > 250(0) categories

February 9th, 2006 | Filed under Greasemonkey, Javascript, MovableType

Warning: Rambling about work ahead.

I went off on MovableType’s atrocious performance while posting to Lifehacker awhile back. Turns out that one of MT’s biggest performance pain points is the huge number of possible post categories the Gawker sites (including Lifehacker) use - a number that goes well into the thousands. (Why, you ask? Well, narrow topic silos and focused category pages make for good sponsorship opportunities and highly-targeted text ads and great Google-fu, and we’re an advertising-supported business.)

Anyway, we use a plugin for MT that turns categories into “tags,” allowing you to enter categories in a del.icio.us style input box versus the clumsy category dropdown. “Go nuts with tags!” was the editorial edict. So we did, adding categories at a clip. Sadly, we were shooting ourselves in the foot. Rendering the interface with a list of hundreds of tags slowed things considerably, specifically, the “suggest a tag” Javascript on the New and Edit Entry pages. Apparently MT’s not built to handle more than 250 2500 categories per site, and we’re the first to push this limit. (Buh? 2500 is a lot more reasonable than 250. Tx Anil.) Also, apparently MT’s database interface makes what only needs to be one query for one recordset one query PER CATEGORY - thus, hundreds of queries per page request, hence the slowdown. (As a developer, can I just say - WTF, 6A? Anyway.)

Gawker’s solution was to remove the helper Javascript from the MT interface and have us enter tags cold; for me and my co-editors this was unacceptable, given how prone we are to typos and crazy variations of the same tag (”Mac,” “OS X,” “Mac OS X”, “Stuff we like,” “Things we like,” “Books”, “book,” etc.)

Fortunately for Gawker, I don’t have any access to the MT installation or template editing/creation for Lifehacker, so I was a bit handcuffed, not able to do much except complain loudly. Finally, to stop the tag mess from getting worse editorially, I wrote a Greasemonkey script which includes the static category list Javascript from afar on those pages, which is super damn fast AND gives us back the past tag helper. I’d publish that script but it’s got a little too much information about our server setup and is specific to the tags plugin, so I won’t. But you get the idea.

If we can get a category template of that Javascript include publishing every few hours and including newly-created tags (the existing one doesn’t update with new tags, boooo), life will be good.

Now back to our regularly-scheduled programming. (Ha!)


Enable image hotlinking from LiveJournal subdomains

February 9th, 2006 | Filed under .htaccess, Apache web server, mod_rewrite

A friend of mine disables image hotlinking from her site using mod_rewrite, but she also syndicates her weblog to LiveJournal, so she allowed livejournal.com to hotlink with her .htaccess file, like this:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?livejournal.com.*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ images/stealingbandwidth.gif [L]

But recently LJ changed their URL scheme to subdomains, so all her friends were seeing her “You’re stealing bandwidth!” image when they read her journal from username.livejournal.com.

So, we modified her .htacess mod_rewrite rule to:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://([a-zA-Z0-9_]+\.)?livejournal.com.*$ [NC]
RewriteRule \.(jpe?g|gif|bmp|png)$ images/stealingbandwidth.gif [L]

And in the process I was once again reminded how the simplest of regex’s can still completely kick my ass.