samhuri.net


By Sami Samhuri

December 2011

→ The Broken Pixel Theory

For example, a clean desk tends to stay clean until a piece of paper stays on it for a couple of days. Similarly, I'm much less likely to care about a 2-3 pixel UI bug when the whole UI is a mess.

Great insight from Majd Taby.

→ New Release of Firefox for Android, Optimized for Tablets

On the other hand, watch this video. Even in Mozilla's own demo - which presumably puts Firefox for Android in its best light - doesn't the whole thing look a bit herky-jerky, in terms of touch responsiveness and scrolling smoothness?

Surely they could do better on iOS though. I have faith in the Firefox team to provide a good experience because they have done so in the past. Modern versions of Firefox are excellent.

New Release of Firefox for Android, Optimized for Tablets

→ My kind of feature checklist

The latest technology I've been learning is Palm's SDK for webOS, Mojo. My first impression is that it's a great platform and Palm could do a great job of 2.0 if they cut down on some of the verbosity of gluing together the UI. I have learned to like JavaScript over the years as I learned that despite its warts there are good parts too. If you squint just right you can see that it's scheme with Algol syntax. HTML and CSS are what they are, but with WebKit running the show and only a single engine to target it's not that bad. I've gone from Eclipse to Emacs for the coding itself and highly recommend Emacs for Mojo development. There is nothing that I miss from the Eclipse or Komodo Edit thanks to the fact that Mojo uses open languages and standards.

As far as actual development goes the Mojo documentation steers you towards a combination of Eclipse, Palm's Mojo plugin for Eclipse, and the Aptana Studio plugin. My editor of choice is Emacs but I decided to give it a spin just to get started quickly, how bad could it be? I'm not going to get into details but I will say that I don't think I'll ever use Eclipse for anything; it's far too sluggish and provides no compelling features for the languages that I use. I tried Komodo Edit and it was significantly better but still not for me. Emacs is great for editing HTML, JavaScript, and CSS so all I really missed from the IDEs were the shortcuts to package, install, and launch apps in the emulator. I headed over to the Emacs Wiki and downloaded Jonathan Arkell's Mojo support for Emacs which provided a great base to get started with. There are wrappers around (all?) of the Palm SDK commands but it needed a bit of work to make it just do what I wanted with as little input and thought as possible.

→ I see HTTP

Icy is a public domain iOS app that lets you see everything a web page loads in great detail. This looks useful.

→ Pure CSS3 images? Hmm, maybe later

Great analysis of the performance of CSS based images. Not directly mentioned, but very apparent, is that the task of making CSS images itself is prohibitively difficult.

A Static URL Shortener Using .htaccess

This blog is statically generated. A few Ruby and Node.js scripts along with a Makefile and some duct tape hold it all together. All of samhuri.net is on Github if you want to take a look. Most of it is quite minimal, sometimes to a fault. Little improvements are made here and there and the most recent one is a neat .htaccess hack. I want to automatically announce new posts on Twitter so short URLs are in order.

I try to strike a reasonable balance between writing everything for this site myself and using libraries. A quick look at a few short URL projects was enough to see they weren't what I was looking for. They were all database backed servers. Comments on this blog are served up dynamically but everything else is static and I try to avoid dynamic behaviour when possible. Comments are moving to a more static system sometime. Anyway I registered the domain s42.ca and nabbed an algorithm for creating the short codes from Jonathan Snook before diving into TextMate to implement my idea.

The result is about two dozen additional lines of Ruby in my static generator, and a command added to a Makefile. The Ruby code generates a short URL for each of my blog posts and then creates a RewriteRule directive to redirect that short codes to each corresponding blog post. Then the directives are dumped into a .htaccess file which is scp'd to s42.ca when I run make publish_blog.

I think this is a pretty neat hack and have not seen this technique anywhere else so I thought I'd share it. Maybe someone else will find it interesting or useful for their blog. How far it scales won't be a concern until I have thousands of posts. That sounds like a good problem for future Sami to solve should it arise.