Friday, November 27, 2009

Code highlighting in Blogger

I just posted an article which demonstrate code highlighting in blogger. I get the highlighting feature from here: http://code.google.com/p/google-code-prettify/

Additional Reference : http://lukabloga.blogspot.com/2008/10/to-test-new-highlighting.html

Hope you enjoy it.

SVN::Notify::HTML::ColorDiff modification

We are using SVN to save our works and hooking a post-commit script which one of the function is to send e-mail regarding the changes that had just made. We are using the wonderful SVN::Notify, a perl application to do the job. It already have the functionality to produce a beautifully diff colored HTML email using the SVN::Notify::HTML::ColorDiff module as the handler.

However, since we are using web based Google Apps Gmail interface as our email client, the HTML was not rendered nicely because the CSS is not applied inside the interface. We need to change the CSS to the inline style. And then I found a patch done here. Because it is a direct hack, I want it to be more generic that the user can choose the inline style or not, then I modified a little bit more. I added optional parameter --css-inline to generate CSS style directly inline with the HTML tags. I had submitted the changes to the original author hoping he will include this option in the next revision. Just in case, I also put it here.

Snippets to add the additional parameter:

package SVN::Notify::HTML;

# $Id: HTML.pm 4617 2009-03-19 17:04:53Z david $

use strict;
use HTML::Entities;
use SVN::Notify ();

$SVN::Notify::HTML::VERSION = '2.79';
@SVN::Notify::HTML::ISA = qw(SVN::Notify);

__PACKAGE__->register_attributes(
    linkize   => 'linkize',
    css_url   => 'css-url=s',
    wrap_log  => 'wrap-log',
    css_inline => 'css-inline',
);

You may download the full source below:

Friday, November 13, 2009

[Linux] Extract files from command-line

Elixir for the lazy...

http://lightlinux.blogspot.com/2009/11/uncompress-files-from-cli.html