Twig library for CodeIgniter 2.x

I’m trying to catch up with this social open source movement. I forked an existing CodeIgniter Twig integration library and added some changes to work with CodeIgniter 2.x.

Also I found a way map any CodeIgniter function to Twig like so.

$this->load->library('twig'); // load the Twig library
$this->load->helper('url'); // load the CodeIgniter URL helper
// map the base_url() function as a Twig function
$this->twig->add_function('base_url');

Then in your Twig view call the base_url() function like this

{{ base_url() }}

Head over to Github for more details.

In case you have no idea what I’m talking about. CodeIgniter is an excellent PHP framework and Twig is a Django style templating engine with inheritance for PHP.

Getting started with HTML5

HTML5 logo

I did a small intro to HTML5 at the last Refresh Colombo meetup last week. Here is the main presentation I used from html5rocks.com.

Here is a better list of resources as well. I specially like Dive Into HTML5 by Mark Pilgrim.

I met @geekaholic and @SeeJay of SinhalenFOSS at Refresh Colombo but had to head back soon after.

Thanks @nazly for the invite will try to hang around longer next time. :)

Update: Mark Pilgrim’s websites went away. I’ve changed the above link to a working mirror. Also you can get a PDF of the book from this site.

Help Translate Shutter to Sinhala

Captured by Shutter :)

I was browsing around Launchpad looking for stuff coming up in the new Ubuntu 11.04 and found Shutter.

Shutter is a feature-rich screenshot program. You can take a screenshot of a specific area, window, your whole screen, or even of a website – apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window.

I also saw this in their Launchpad page

==========
WE WANT YOU! Please help us to translate Shutter to every possible language.
==========

Translate the main program and shutter plugins: https://translations.launchpad.net/shutter

So I thought I’d help out and started translating to Sinhala. It wasn’t easy at first I had to setup some fonts and get a decent keyboard working.

Have a look at Adding Unicode Sinhala to Linux if your on Linux. I found the Sinhala transliteration keyboard to be the easiest to use.

Going along that path I found Type in Sinhalese – Google Transliteration

So if you can spare some time over the holidays help to complete translating Shutter.

Introducing Open Path IT

I finally setup a company for myself. Yay for me! Don’t believe the hype just yet. Then again there isn’t much hype about it right now. I’ve been trying to drum up some interest over the holidays but it was harder than I thought.

I might be a bit late to the website-company party but I’m packing a whole lot of punch behind it. I have a pretty good team around me that lets me do this.

We are starting with Sri Lankan small business websites so we can give a more localized and personal service. We believe we have something unique to offer. Ya I’ll be using ‘we’ a lot but its mostly just me. ;)

A few people asked me. Why do websites? Isn’t everyone else doing it? Well ya but that’s something I know I can do well and its a simple enough business to start when you know a bunch of good designers, and they do all the work for you.

My general instinct is to stick to something unique and untouchable but in this case I’ve seen many cases where we can do a better job.

We don’t have a killer solution (not yet at least), to be honest we can only handle a handful of clients at a time. But I think our clients like that we are small and spend some 1 on 1 time with them and get things right.

I’ve been building websites off and on since 1996, it was Mosaic times back then and we were exited about getting HTML tables!

Its a whole new ball game now. We are come very far in Internet time. So bring it on! We are here to play.

Pay Yourself First

Paying yourself first is good financial advice. I’m going to need to do some of that for my sites as well. I was going through some of my old sites, ideas and domains and they are not doing so well.

Dilantha.info is okay as far as WordPress core is concerned but the old K2 theme and numerous plug-ins are killing my page performance.

Date05/12/2010
Average page load10.9s
Home page size1MB
Requests on home page49
HTML requests7
CSS requests7
JavaScript requests19
Images11
Flash4

I was getting very few search hits as well. The reason was my Sitemap plug-in was broken, and the web crawlers were not picking up the latest content. Bummer.

So looks like I have some tinkering to do over the holidays. That’s good considering I was demoted from Christmas decorations due to my lack of taste :(