Skip to content

Scripting OmniGraffle: MySQL Visualization & JSON Representations

OmniGraffle is a great tool for visually mapping out complex relationships or hierarchical structures. Often when working in groups where some of the personnel have no programming or mathematical background OmniGraffle is a great tool to bridge the gap. Converting OmniGraffle Hierarchy to JSON Often I’ll use OmniGraffle to map out site structures with non-programmers. The challenge is once everything has been done in OmniGraffle it is normally a manual process to convert the data in OmniGraffle to a structured data representation, like JSON, that is easy to programmatically work with. Or, in my specific case, output the structured OmniGraffle document into a text document that could be reviewed and edited by others on a Google Doc…

Continue Reading

JPEG + PNG Color Management Strategies for the Web

The first step in the design process of any website is to mockup the design in Photoshop. One of the most frustrating parts of the design process can be converting your mockup into image slices whose colors mix well with native CSS styles. Mark Edwards, over at Bjango, has a great writeup on color profile management and UI design. The basic tenants are: don’t color manage, use native monitor color profile, use RGB, and do not attach color profiles to JPG or PNG images. However, in my senario, I often work with graphics that have been designed by people who work in print and don’t understand web image generation in the slightest. Often I’ll receive unoptimized PNGs, JPGs in CMYK, images with color profiles, etc…

Continue Reading

Copy Path / Directory to Clipboard OS X Lion Service

Someone at work recently wanted an easy way to get the path of a file in a format he could paste into an IM or an email. I wrote up a quick applescript and bundled it into a service which enables a user to easily copy the path of a file to the clipboard. The package also includes a service that copies the directory path of a given file to the clipboard. The biggest use case for this service is for an office environment where many people are connected to the same drive externally via VPN or internally via ethernet. It is challenging to easily point a colleague to a specific file if your shared drive is badly organized (which, odds are, it probably is). This tool mitigates most of that issue and works consistently across machines.

Continue Reading

Compiling PHP 5.2.11 on OS X 10.5.8

I’ve detailed this problem before but yet again I’ve encountered the infamous iconv compile error. This bug is not new yet it still has not been fixed in the latest PHP release. When compiling a custom version of PHP with libraries such as libxml and iconv the make process results in a linking error relating to the iconv library. The problem arises because I have two versions of iconv installed – the macports version in addition to the standard installation. A linking conflict arises and to eliminate the error a linking search order change (which is detailed in my previous blog post) must be made…

Continue Reading

PyObjc & Seemingly Incorrect Return Value Mismatch

I’ve come to love developing in PyObjc. Sure, it has its quirks, isn’t the fastest, and isn’t the easiest to debug when something goes really wrong (aka imperfect integration with the xcode IDE); but it is fast to develop in. Almost every seemingly complex task that has come my way has been 50% completed by some open source python module that I can include in a commercial app without any licensing trouble. However, the other day I came across a bug (at least, what I thought was a bug) that seemed very blaringly obvious and for a production version of a scripting bridge…

Continue Reading