Entries Tagged as Misc

Commencing Radio Silence...

I'll be away camping this weekend, so if you're leaving comments on my awesome plugin posts and I'm not answering, that's why! I'll be back Sunday afternoon. See you then!

in Misc | No Responses Yet Posted 2008-07-25 04:00

2 Easy Ways To Make CAPTCHA Easier For Your Users

It occurred to me the other day, while filling out a CAPTCHA to leave a comment on a friends blog, that there is further room for improvement in most implementations, putting aside for the moment the fact that there are better alternatives. But if you have ever used a CAPTCHA before, chances are you've asked yourself this question: Is it case-sensitive?

And is it? Who knows?!

The solution!

Hardly anyone goes out of their way to indicate whether the CAPTCHA response is case sensitive, and, even worse, some even use fonts where the lower-case-L and upper-case-i -- and this isn't the only set of easily confused letters -- look essentially the same. As long as they're not getting spammed, that's good enough for them. Sadly, the solution is so easy that the careless among us are only hurting themselves. A simple CSS addition can make a world of difference.

Step 1:

Only use capital letters. This alone won't solve your problems, but capital letters are much more easily distinguished from one another in most fonts. Even if you don't have a nice pretty configuration screen for your CAPTCHA asking for a set of characters to choose from, I guarantee you it's in the code and would be a piece of cake to change. For example:

[viewcode] src="captcha.cfm.txt" showsyntax=no geshi=cfm[/viewcode]

Step 2:

Add a text-transform property to your CSS for the CAPTCHA response input field. Specifically, text-transform: uppercase;. This takes away almost any doubt a person might have over case sensitivity. Try it yourself; type some text in this box and see how much better life with CAPTCHA can be:

Extra credit:

Add a small line of text next to your CAPTCHA explaining that case doesn't matter. If you have the ability, choose a font with unambiguous characters.

in HTML/CSS | Misc | No Responses Yet Posted 2007-10-31 07:00

Firebug and GMail don’t play nice together

This morning when I logged into GMail I saw this alert:

GMail alert for Firebug users

The "Fix this" link takes you to Google's Help Center page regarding the Firebug & GMail issue.

Sure enough, I disabled Firebug for mail.google.com, and it's been nice and snappy ever since. I emailed the same information to Ray so that maybe they can fix the root cause -- if it's in the Firebug code and not the GMail code -- instead of just creating this workaround.

in Misc | No Responses Yet Posted 2007-10-30 08:22

Regular Expression Search and Replace with Perl

God, I thought I was done with Perl. It always finds a way to resurface in my life, though, and I don't suppose that's such a bad thing.

On a debian server I'm running, I had the need to create an HTML file with links to a series of files in the same directory. With a couple of commands, this was cake!

First, list all of the files and save the output to an html file:

ls myfile* > myfilelist.html

This creates a file myfilelist.html with contents similar to:

myfile1.txt
myfile2.txt
myfile3.txt
myfile4.txt
myfile5.tar.gz
myfile6

Then we want to turn this list of file names into links. This is pretty easy with a RegEx search and replace:

perl -p -i-OLD -e 's/(^myfile*$)/<a href=\"$1\">$1<\/a><br\/>/g' myfilelist.html

There are a million and one perl documentation sites out there so I'm not going to document every flag and every option, but the important stuff is:

  1. The i flag tells it to edit inline. Using -i-OLD will backup the file as [filename]-OLD before performing the search and replace.
  2. 's/x/y/g' does a Global Search and replace of x with y.
  3. Don't forget to escape special characters like quotes and slashes.

in Misc | No Responses Yet Posted 2007-10-05 09:14