Archive for the 'Code' Category

Patching StaticMatic’s deficiencies: setting HAML options and fixing the locals hash

Sunday, November 30th, 2008

Staticmatic 0.9.4 ships with 2 surprisingly serious deficiencies:

1. Configuration options can’t be passed to HAML
2. The locals hash isn’t passed to partials

The solution for partials has been given by Randy Parker.

The solution for HAML options has been given by Jason Tennier.

Either of these issues would have been a dealbreaker for me, so I was glad to see they both had relatively easy fixes. Although coming from the Perl world, I do get pissed off whenever I have to hand-edit the source of a gem :)

And as a newbie to StaticMatic, I do wonder how well the gem is being maintained now. Both of these patches have been around for a while, yet they haven’t made it into the distribution, and I wonder why?

Updated: So the maintainer says he’s been busy, fair enough. With the bug fixes above in place, Staticmatic is nice enough. Having an application server obviates the need to “build,” and if you know me you know how much I hate the build process ^.~ So that to me already sets staticmatic apart from other template engines. I’m really looking forward to 2.0

News groups and mailing lists 2008

Saturday, September 27th, 2008

I’ve got some suggestions as to which usenet news groups and mailing lists (or listservs) are worth following with regard to keeping up-to-date on what’s happening in Client-Side (or Presentation Layer or Front-End) Web development.

(more…)

Progressive Enhancement

Thursday, September 25th, 2008

One of the things I was doing while working for the College Board was researching strategies for accessible Web content. So it became apparent that Pragmatic Progressive Enhancement, or what we used to call Graceful Degradation, was in fact the best architectural strategy for ensuring an accessible and robust user experience.

(more…)

Delicious via: tag bookmarklet

Saturday, August 16th, 2008

I just got finished writing a new version of the del.cio.us whuffie bookmarklet. It’s a bookmarklet that adds via: tags to your bookmarks for attribution purposes, so you can have a little extra meta-data about where your links are coming from.

(more…)

Firefox Extensions

Thursday, August 14th, 2008

Lately I have been fielding a lot of questions at work about strategies for assuring that the markup is semantic, accessible and valid. I recently compiled a short list of Firefox extensions that test whether XHTML is standards-compliant.

(more…)

Software systems as big balls of mud

Friday, July 25th, 2008

The critical point to remember about Software Systems as Big Balls
of Mud,
is that it is not an anti-pattern. The statement that applying top-down practices to software results in a Big Ball of Mud is an affirmation that

(more…)

HTML Validation

Sunday, October 28th, 2007

Today I wanted to know how to get the functionality of the HTML validator Firefox extension. The extension has two modes: Tidy and SGML parser. Each of these modes reports differently on the HTML under test. Both reports can be useful (I’m not going to get into the differences here).

Specifically, I wanted to be able to generate either a Tidy or an SGML parser report from the command line. And I wanted to be able to run my report for any public Web page.

(more…)

del.icio.us whuffie

Saturday, June 16th, 2007

This bookmarklet no longer works. Please use the new whuffie bookmarklet instead. This version of the via: tag bookmarklet broke when Delicious launched their new UI in mid-2008. Congratulations to the Del team on the improved UI, and I hope everyone will enjoy the updated bookmarklets.

Delicious Whuffie is a bookmarklet that, when clicked, adds via:username to the tags field when saving a URL from another user.

This bookmarklet is intended to be used on the “save this” page at del.icio.us. I have also created (and prefer) a version of the bookmarklet that adds the user’s tags along with via:username; as I seem to always do that as well when tagging with via:

(more…)

Neat little example of a useful Javascript closure

Sunday, May 6th, 2007

Closures are a powerful feature of JavaScript. However it’s often hard to explain in a few words, just what is useful about closures. Well, here on page 131 of the Rhino book, is the recipe for a unique ID generator that doesn’t require a global counter.

One thing that I personally enjoy about the Flanagan book is that he says things like “don’t pollute the global namespace.” :) This technique does not pollute the global namespace.

var uid = (
function(){
var id=0;
return function(){
return id++ ;
};
}
)();
//then just say:
alert(uid());


Notes on getting PNG transparency in IE6 with pure CSS

Sunday, December 24th, 2006

Recently, I started building a site with a lot of transparent image elements. The trouble was the the client required support for IE6 as well as IE7. Now, IE 6 and lower do not support transparent PNGs out of the box, but I knew that there were workarounds for that.

The question was, which workaround to use? One method I saw involved using an Explorer “behavior.” Unfortunately, this solution required loading and HTC file, which is an ActiveX control. ActiveX controls aren’t loaded in IE6 with default security settings. Maybe there is a workaround for that, but I couldn’t find it in a timely fashion. Besides, the HTC solution requires an HTC file and a special GIF file be stored on the server. Adding mysterious stuff to the client’s file tree is something I really like to avoid.

Then I ran across a brand new article (based upon a much older article) at A List Apart: Super-Easy Blendy Backgrounds. This article describes a pure CSS technique of getting image transparency to work in IE 6.
(more…)