Monday, December 27, 2010

Quick workaround for broken handling of Play/Pause key in Winamp

The Play/Pause key on the Microsoft Natural Keyboard 4000 (and other media keyboards) doesn't work properly when Microsoft's Intellitype software is running. Somehow Winamp has left this unfixed for years. Here's a workaround:

In the Intellitype settings (Control Panel -> Keyboard -> Key Settings), change the Play/Pause key to a macro that sends some other keystrokes, e.g., Ctrl+Shift+* (Intellitype makes the Alt-key hard to record, so I leave it out). Then, in Winamp's settings, enable global hotkeys and change the Playback: Play/Pause hotkey to the same value.


Saturday, October 9, 2010

Perl one-liner, bumping a version string

This takes a version string like "1.23f" and turns it into "1.23g" (or adds "a" if there's no trailing letter):

perl -lpe 's/([^a-z])$/$1a/ || substr($_, -1) =~ tr/a-z/b-za/'

Wednesday, February 24, 2010

Wordpress Fail

If you have a wordpress blog, try the following:

   1) Create a new post
   2) In the visual editor, start a line with a few spaces followed by some text
   3) Click 'Preview', or click to the HTML tab then back to the Visual tab.

You'll notice your leading spaces have disappeared. Begin rant mode. WTF. This is like web dev 101. Just convert them to &nbsp's already. But it gets worse. Let's say I decide to work around it and manually add the &nbsp's in the HTML editor. Now, switch back to the visual editor. Ahh, leading spaces at last. Let me just switch back to the HTML editor for one last tweak...... #$@!$#% leading spaces are gone again! Unbelievable.

I found one attempt to fix this - unfortunately it's just a bandaid hack and it only works inside shorttags for a specific wordpress plugin.

Fail.