Software
I have benefited greatly from open source software and this is my small way of giving back. At the moment, there's not a lot available here. It takes some effort to package up source code for use by others and I simply want to do a good job at this. I am slowly but surely preparing a few projects for download here. In the meantime, try out some of these smaller scripts. If you have any feedback good or bad, I'd love to hear from you.
Do you want to take an HTML document and have browsers render it in two newspaper-style columns? I did. So I created this basic
jQuery extension to do just that. It's simple: call makeNewspaperColumns on a DOM element and it will split its contents into
two div elements which you can apply CSS styles to so that they appear as newspaper-style columns. The algorithm used is
fairy naive. The content is spliced roughly in half based on the number of characters in the HTML. I hope to improve it once I start to
see how well it works on real-life HTML scenarios here on this site. But for now, it works okay for simple HTML.
Do you have an Apple laptop running Mac OS X 10.3 or later? Have you ever wanted to perform a task whenever a power state change occurs (e.g., switching to AC power or switching to battery power)? Then try out this simple utility. It executes a command when your notebook switches to AC power or when it switches to battery power. Of course, you can have it check for both types of state changes and have it execute different commands for each. This has been tested on an iBook G3 under Mac OS X 10.3 and a MacBook Pro Core 2 Duo under Mac OS X 10.5.
Usage: canary [option] ...
Options:
-a <shell command> Command to launch when AC power begins
-b <shell command> Command to launch when battery power begins
Example:
./canary -a "osascript -e 'tell Application \"Finder\" to say \"AC Power\"'" -b "osascript -e 'tell Application \"Finder\" to say \"Battery Power\"'"