Yes! Syntax Highlighting for Mako in TextMate!

May 31, 2009 § 1 Comment

For the longest time I kept staring at ‘plain text mode’ while editing Mako templates. No Mas!

TextMate bundle for Mako template has existed.

To install:

  • cd ~/Library/Application\ Support/TextMate/Bundles/
  • svn co

After Reloading your bundle, syntax highlighting is available under HTML (Mako).



HTML Quickie: Long String Overflowing Your Div

May 25, 2009 § 6 Comments

Do you have that problem? I do.

EDIT(05/31/2009): Even better solutions:



General CSS solution:

overflow: scroll


The HTML solution:

use <wbr>. (But you have to figure out yourself where to put the tag)

The IE-specific CSS solution:

word-wrap: break-word

PHP solution:

wordwrap(‘your_very_long_string_here’, 15) // Break after 15 characters

Python solution:

import textwrap

textwrap.fill(‘your_very_long_string_here’, 15) # Break after 15 characters


The Male Programmer Privilege Checklist

May 25, 2009 § Leave a comment

Original Article here:

The article is thoroughly descriptive and I didn’t even realize some of them until I read it.

Pylons Quickie: Mako Output

May 24, 2009 § Leave a comment

By default Mako HTML escapes all output.

To NOT have this behavior, change the setting of TemplateLookup in


Pylons Quickie: I want to use distance_of_time_in_words

May 17, 2009 § Leave a comment

distance_of_time_in_words is a useful function that converts boring looking datetime into something more attractive (and SEO optimized) like: 30 seconds ago.

Pylons gain this functionality via WebHelper which blatantly inspired by Rails.

But, out of the box, this functionality does not exists in my templates. To enable it, I need to add this line in

from import distance_of_time_in_words


WebHelpers Documentation

Laconica: Open Source Twitter

May 16, 2009 § Leave a comment

There are so many micro-blogging services nowadays. Sooner or later there will be an open source application for it.

And that application is called Laconica. It is written in PHP.

I haven’t try to install it yet, but it sounds fun.


The project’s Trac

SqlAlchemy Quickie: How to use Distinct

May 15, 2009 § Leave a comment

distinct() method is accessible from Query object. The documentation is kind of obscure, so hopefully this post is helpful for others.


def get_all_category(cls):
return meta.Session.query(cls.category).distinct().all()


SqlAlchemy 04 Documentation about Query object

Where Am I?

You are currently viewing the archives for May, 2009 at RAPD.