| Author: | bbum <bbum@mac.com> |
|---|
This directory contains random projects and chunks of code that either solved some random problem or were created to explore something.
For the code to be here, it "worked". The definition of "work", however, may range from rendered a useful application that I rely upon daily to demonstrated that some random bit of API can or cannot be exercised in a particular fashion.
I will try to denote what definition of "work" any given production falls under as that may be of interest to others.
DropInspect is a PyObjC based application that accepts drag-n-drops of many standard pasteboard types. Upon the drop, DropInspect displays a table of all of the types that were found on the pasteboard. If a type includes an 8 digit Hext number, it is assumed that it is a 4 character type code and a second column displays the type. Any one pasteboard's contents can be dumped to the console by pressing a button.
The app also accepts pasteboards by paste. That is select anything in any application, click on the DropInspect window, and paste.
DropInspect does not have any knowledge of the types on the pasteboard. That wasn't a part of the original problem.
DropInspect was written during a Cocoa/Java project to figure out how to accept drag-n-drops from some other application outside of my control. I knew one type on the dragged pasteboard, but that one type was not the type I really needed. So DropInspect was created as a generic way to introspect pasteboards.
It has proven intermittently useful over the year(s). I think it was originally written in the late 2002 or January of 2003 timeframe.
Microsoft Word has a document format that is designed for printing labels. You type in a bunch of addresses into the label boxes and it prints them. We had been using this to store all of our family labels-- holiday lists and the like-- for years and wanted to import all of the data into Address Book.
Save Word label documents to Word HTML format (not HTML archive) and then parse the resulting HTML file with this script. It will write a file containing vCards for all of the addresses found within the HTML.
The script is a one off optimized for our particular set of addresses. It worked well for us, may not work so well for others. I tossed it into subversion because I will apply patches and maintain it if others find it useful.
Reads an XML style Property List from Foundation turns it into a set of Python collection classes. Will decode binary data.
Converts PDF documents to PNG images using the Quartz Python bindings found on Mac OS X. Works best with screenshots taken on Panther. It will write multi-page documents to multiple PNG images, one page per image, but the rendering isn't very clean. I have no idea why as converting screenshots to PNG was the problem to be solved.
httpflow parses the output of tcpflow with the intention of reconstructing any captured http communications. It was a quick hack that was used to track down some cookie handling problems in a site that I was working on. It is also very useful for peeking at web service communications where the client application is relatively opaque.