Introducing Your New YUIDoc Theme

I like YUIDoc. I don’t like its default theme. Since I couldn’t find any other themes on them internets, I wrote my own, named “Dana”.

Since I normally use YUIDoc to document either pure Javascript or jQuery code1, I didn’t keep any of the old YUI code; I’ve ditched pretty much everything and started from scratch. And this is what I’ve come up with:

Screenshot of one of YUI's many many classes

As you can see in the screenshot, as an example I’ve generated the well-known YUI API docs. So here’s the original YUI documentation in its original look — and here is the very same documentation sporting the new Dana theme.

I hope you find the latter more pleasing just as I do. :) Click around a bit; check some of the class documentations for a more in-depth comparison; play with the filters; feel the luxurious yet cheap plastic underneath.

This is a work in progress. It’s reasonably stable and working for me so far. YMMV. If you encounter errors, please create a ticket.

You’ll find “Dana” on GitHub. If you’re so inclined, you can dowload the latest stable release as zip/tgz file, too.

Dual-license, MIT & GNU GPL v2. Tested in Safari 5 (OSX), FF3.6 (OSX), IE8 (WinXP).


  1. Why yes, YUIDoc works just fine for non-YUI JS code. 

Ephemera v1.3

I’ve just released Ephemera v1.3.

It’s a bugfix release which hopefully should fix issues with stalled fetching for both very large as well as empty unread lists.

Still running: Minimalist, Week 15

Over the last few months I’ve been clocking in ~180km in my Vibram FiveFingers. For the most part I take it slow; I run when I feel like it (which is rather often), and I check out routes I’ve not ran before. Sometimes these are long, sometimes not so much.

And I’m happy to say that apart from a one-time, mild case of shin splints caused by running too slowly (I’m not kidding) a few weeks back which “grounded” me for a few days, I am without injury and pain. I run a lot on paved roads these days, due to the currently bad weather and my unwillingness to wrestle muddy tracks. Back in my Nike days, this usually gave me bad sacroiliac joint pain. These days, I’m fine. No complaints, really.

I’ve bought a second pair of FiveFingers KSOs a while back, and since my current client is a KSO fan and owner as well I was able to wear them in the office. It’s good, really.

So yes, I’ve embraced minimalist running. Not just in the shoes department, but also in my mind. My stance towards me running has changed over the last few months; I’ve become more relaxed and calm about it. It doesn’t feel like a drag anymore, like something you just have to suffer through; I run because I like it and because I want to.

Most days I don’t even take a watch with me; I glance at the wall clock when I head out the door and check it again when I come back. That’s accurate enough. And in order to find out the distance I’ve traversed I turn to Google Earth or DailyMile’s handy “pedometer” map feature.

My feet have become stronger, I think my feets’ arches are not as flat anymore, and my toes have straighten out a wee bit. The money I’ve spent on my FiveFingers was a good investment in my health, methinks. The downside is that I don’t like my “real” shoes anymore. ;)

A sweet side story: when my parents visited us a few weeks back, they saw the FFs and tried them on, deciding they like them. So they’ve both bought a pair, and to my big surprise picked up light trekking as a hobby! Even my mom is having fun. So much, in fact, that they both bought a second pair “for colder days” — KSO Trek. Clearly, I’m an influencer…

So, minimalist running still works for me; it works very well, in fact. And I still enjoy my Vibrams. And yes, I would and do recommend both to everyone interested in running.

NYTimes: Rivals Seize on Troubles of Facebook

Ultimately, I doubt there’ll be enough momentum for any of these sites to really take off. And yes, I say that despite me backing Diaspora*. But I believe they will fail to attract a serious following because in the end, you go where your people are, and they’re not there yet. Herd mentality meets chicken & egg.

I—as an end user—would need to decide whether my jumping ship @ FB is more important than loosing the “posse” I’ve built there during the time I’ve used the site. And I think for most people the answer would be “no”.

That being said, I approve of all of these efforts to build some much needed competition for the four thousand million pound gorilla that is Facebook. The prospect of having a portable profile (see Diaspora* for more info) is exciting, but while I hope that their plans come to fruition (especially their hosted service) I remain skeptical.

Still running: Vibrams, Week 2

Tuesday, April 27, 2010

Wore my Nike Free yesterday, as they’re the most flexible (actual) shoes I own. No time for running, tho, also still some residue muscle pain.

Today: Beautiful morning, decided to ignore the bus and walk to the subway. 3.5 km in my Nikes, and while they’re pretty good, I miss the ability to wiggle my toes.

Came home, went for a 3.5 km VFF walk with Dana. My calves seem to man up, finally. With a bit of luck I might be able to go for a run on Thursday again!

Wednesday

Came home, my legs still aching a bit, but I thought “eh, what the eff” and went for a 5 km run. Didn’t even take a watch or anything; I just felt like running. The last time this happened to me was never. And I had fun.

To be honest, the combination of THE BOOK and MY NEW SHOES caused this almost eerie, constant desire to get out and run. I’m not making this up; it’s uncanny. I’ve never had this urge to just crunch some miles. And it’s not because of stress at work or anything. I’m calm, I’m my usual sunny self, not stressed out… It’s just a deep-seated feeling that running would be the right thing to do right fucking now. For no apparent reason. (Perhaps they’ve put brain-altering chemicals into the book; I don’t know… I don’t know.)

And I won’t lie, I’ll enjoy it for as long as it lasts. It might go away tomorrow or next week or in five years time, I don’t know, but I’m cool with it. There are worse urges, really.

Also: I can predict the future! Tomorrow, walking will hurt. (I wish my calves would man up quicker.)

Thursday

Turns out I can’t predict the future after all — I can walk rather painlessly today. Apparently all the extra post-run stretching and muscle rubbing1 was a good idea.

Had a discussion with another (ex) Y! about running barefoot’ish. It’s not just about not running on your heels, but about foot strength/health in general. In running shoes, the foot’s arch is bolstered and propped up to various degrees. And your toes are pretty much suspended. When running without shoes, the arch acts like a spring, and the toes react to the underground, but they can’t do that when shod.

The difference is not just that you’re running on your forefeet, it’s about giving the foot (and therefore the leg) a chance to work as intended.

Friday

5 km, ‘twas okay — not more, not less. The humidity took me a bit by surprise, and my big lunch wasn’t helping the cause either. So: eh.

My lower legs are slowly adjusting to the change. Atta boys!

One of the Vibrams is slowly coming apart a bit at the heel (where the mesh is glued to the rubber “skin”), which is a bit strange after only one week of moderate use. They’re not falling apart or anything, their function isn’t impaired, it’s just a visible “glitch” I’m not too happy with. They’re one week old after all.

I’ll hit the sports store on Monday and ask for either a replacement or (some) money back.

Saturday, Sunday

Rest of the week were wasted on shitty weather and/or me freezing, so no running.


  1. Not an euphemism, thankyouverymuch. 

Still running: Going Minimalist

Reading Christopher McDougall’s highly interesting and inspirational “Born to Run”, I came back to my idea of running (semi-)barefoot. Turns out there are a lot of people with the same idea, and companies catering to this idea. So last Thursday I treated myself to a new pair of Vibram FiveFingers KSO.

VFF are basically what you would get if you dipped your feet into molten rubber, minus, you know, the excrutiating pain, blistering skin and earache caused by your own frantic screaming. They’re a thin, highly elastic second skin for your feet, and not much else, really. Needless to say, I love them.

Being the serial enthusiast I am, I’ll try to keep a short-form diary of my semi-barefoot running progress and findings for my own sake.

Thursday, April 22, 2010

Was paid by a client today, there’s money to be spent! Went to the sports store to see whether they have Vibrams in stock; the answer was a resounding yes. Tried them on and was sold. 10 minutes and €105 later I was the proud owner of a brown pair of Vibram FiveFingers KSO.

Wore them on my way home; not bad. A bit strange at first, but I quickly forgot about them. Went home, the weather’s nice, decided to go for a quick and easy run. Didn’t expect much, but was surprised.

Without trying to, I ran the first 5km straight, without much effort or being winded. Had to take a quick breather (while walking) because I was starting to feel light side stitches. Walked for ~250m, then took off again. When I got home and checked my time, I noticed I had beaten my usual time by roughly 5 minutes. And I was barely exhausted after those 7.4km.

The fun thing about barefoot running (or running with nothing but a thin layer of protection wrapped around your feet) is that your body instinctively knows what to do. You straighten up involuntarily, you (normally) don’t land on your heel but on your fore- or middlefoot, and you keep your feet right below your frame while running.

All you have to do is forgetting your old shod running style, really, and listen to your instincts.

Now, when your feet are cushioned (i.e., stuck in your average shock-absorbing running shoe), you tend to land heel-first while going for long strides. A long stride means more distance covered per step, right? True, but it’s rather unnatural, because if you’d do it without shoes, you’d end up in a world of pain as the body isn’t made for this kind of self-beating.

So, after the first few steps in my new VFF my body adjusted. I was going rather slow, well within my comfort zone, my back was straight as a candle, yet I didn’t fall into my usual thump-thump-thump rythm.

Awesome shoes! To be fair, when I got home I definitely felt my calves… they were more sore than usual. No, wrong… They were sore, and they usually aren’t. Then again, usually I am sweat-drenched and exhausted by the time I am back on my own doorstep — not this time, so I consider it a good deal. :)

When Dana came home, she wouldn’t stop laughing at them.

Friday, April 23, 2010

Holy shit, my calves. They feel like I’ve actually used them for the first time in my life.

Still, have a good feeling about the Vibrams; even about my calves. I was expecting sore muscles; after all, I’m completely changing the way I run. Obviously, I’ve done that.

Wore the VFF when getting out for lunch. Not much walking there, but I felt like giddy like a little boy about his new Spongebob shoes, and I never want to take them off again.

Saturday, April 24, 2010

Took Dana to the sports store so she could see whether the Vibrams are something for her. Like me (even more like me) she could use stronger feet, and naturally I want to share this new sensation with her. She’s picked out a pair of grey KSO.

After we got home we went for a casual 5km walk on my running trail. She liked it, although her feet and legs were a bit sore. Don’t tell her, but I was expecting this. ;)

My calves are still hurting a bit.

Sunday, April 25, 2010

Beautiful day, and despite the slightly sore muscles I decided to run. Not the best idea I’ve ever had, really. ;) Now they really hurt.

Well, suits me. I don’t blame the shoes, tho. I just didn’t listen to my body; the outcome should teach me.

Stupid me, always pushing too hard.

Ephemera v1.1

Last night I’ve released a new version of Ephemera, my 2-way Instapaper/ebook-reader sync tool for Mac.

Here’s what’s new:

  • NEW: The app runs on both 32 and 64 bit Snow Leopard now.
  • NEW: When auto-sync is enabled and you plug in your reading device, Ephemera will show a “Going to sync…” dialog for 5 seconds, where you can temporarily disable syncing.
  • NEW: Support for password-less Instapaper accounts.
  • FIX: Preferences menu item will be correctly disabled during sync.
  • FIX: Multiple concurrent syncs will not stall anymore.
  • PLEASE NOTE: Involuntary archiving of all your unread articles at each sync will happen if you’ve set your Instapaper account to automatic archiving. See this support thread for how to change said Instapaper setting.

I’m especially happy about the 32 bit compatibility. Turns out I’ve managed to dig up an issue in MacRuby 0.5. Thanks to Thibault and the rest of the MR crew for hunting it down and fixing it. Hat tip, guys. :)

If you’re using Ephemera already, its auto-updater will pop up soon enough. If not, go take a look.

If you like Ephemera, feel free to spread the word (there’s a little “Share” widget on the site), or tell IUseThis how you feel about the app. Thanks!

Assorted MacRuby Snippets #2

This post references MacRuby 0.5, used with Xcode 3.2 on Snopard (10.6.2); the general technique will likely work on other OS/Xcode version, tho. Just saying.

Apps with more than just one framework

The standard MR app template massages $LOAD_PATH a bit in order to have apps which embed the MR framework use said embedded framework in Release builds. The piece of code in question looks like this:

if Dir.exist?(NSBundle.mainBundle.privateFrameworksPath)
  $:.map! { |x| x.sub(/^\/Library\/Frameworks/, NSBundle.mainBundle.privateFrameworksPath) }
  $:.unshift(NSBundle.mainBundle.resourcePath.fileSystemRepresentation)
end

Which is quite alright if all you embed is the MacRuby framework and are building a release. But as soon as you add another one (Sparkle, for example), the test will always be true, whether you’re debugging without embedding MR or not, and your console will show Ruby load errors. The fix is easy, but it took me a few minutes to find the issue, so here we go.

if Dir.exist?( File.expand_path("MacRuby.framework", NSBundle.mainBundle.privateFrameworksPath) )
  $:.map! { |x| x.sub(/^\/Library\/Frameworks/, NSBundle.mainBundle.privateFrameworksPath) }
  $:.unshift(NSBundle.mainBundle.resourcePath.fileSystemRepresentation)
end

Just a heads-up: the rb_main.rb template in the current MR nightlies doesn’t contain the code above anymore — it appears the “magic” was moved into macruby_deploy (changeset), so it’s likely my fix will be unnecessary in MR 0.6.

Accessing the Keychain with MacRuby

This post references MacRuby 0.5, used with Xcode 3.2 on Snopard (10.6.2); the general technique will likely work on other OS/Xcode version, tho. Just saying.

At some point in my project I needed to access OSX’ Keychain to store sensitive userdata. Unfortunately, due to the lack of void pointers in MacRuby 0.5 (see Trac ticket), I couldn’t use standard methods like SecKeychainAddGenericPassword. The guys on the mailing list told me to use a wrapper instead. Doing some reading and poking around the interwebs I finally figured it out, and since it’s a neat trick I thought I’d scribble it down, so maybe it will safe someone in a position like me a bit of time. ;)

I’ve decided to go with ExtendMac’s EMKeychain class because it’s simple, clean, free and has a liberal license (MIT license, if I’m not mistaken).

Disclaimer: I’m not a Obj-C person, and what you’re about to read is what works for me. I’ve tinkered until everything was moving in the right direction. There might be better ways (I’m pretty sure there are), and if what I’ve done here is bollocks, I’d be delighted if you would share your knowledge with me. :) Also, I’d enjoy a comment with your thoughts about this here article. Any opinion will do. Just curious is all.

Step 1: Build the wrapper, EMKeychain.dylib

First, we’ll have to make EMKeychain into a dynamic library. Download it from the site, unzip it, and fire up Xcode. There, start a new project of the type “Cocoa Library”.

Starting a new project of the type "Cocoa Library"

When asked for the name, call it “EMKeychain”. It kind of makes sense. This is what you’ll end up with:

New project view

In the screenshot you’ll notice a file called EMKeychain_Prefix.pch. That’s a so-called “precompiled header”; Xcode creates it automatically for you on project creation.

Next, add the files EMKeychain.m and EMKeychain.h to your project by dragging them from the download folder to the “Classes” folder.

Two files added to the project

Since the EMKeychain documentation said the class needs to be linked against Carbon and Security frameworks, do that by right-clicking on the “Linked Frameworks” folder in the tree and selecting Add Existing Frameworks…:

The linked frameworks show up in my project

Following the related MacRuby tutorial’s advice, add a constructor to the end of EMKeychain.m:

void Init_EMKeychain(void) { }

Next, adjust the build settings — switch the base SDK to 10.5…

Base SDK set

… and enable GC.

GC enabled

Build a release, and you’ll have your wrapper.

Step 2: Using it

Now for the fun part.

  1. Add the just built EMKeychain.dylib to your MacRuby project. (Don’t forget to copy the file over.)
  2. Add EMKeychain.dylib to Targets ➔ [project name] ➔ Copy Bundle Resources.

And that’s it. If all went well, you should now be able to use EMKeychain’s EMGenericKeychainItem.

Step 3: Mopping up

It’s very likely that when running your release build it’ll crash and burn and complain about a missing /usr/lib/EMKeychain.dylib. In this case, you’ll have to adjust the built executable accordingly using install_name_tool.

You can do that by adding a new Run Script build phase to the target, which should contain this code.

install_name_tool -change /usr/lib/EMKeychain.dylib \
  "@executable_path/../Resources/EMKeychain.dylib" \
  "$TARGET_BUILD_DIR/$PROJECT_NAME.app/Contents/MacOS/$PROJECT_NAME"

It’s possible that on the next build the executable will mope about a missing /usr/local/lib/EMKeychain.dylib now. Duplicate the snippet and adjust the second one accordingly.

Step 4: Get yourself a beer

Because if all went according to plan, you’re done. :)