Sofware Development Archive

Indent your HTML code with a Smarty plugin

XHTML code

If you are using Smarty as a template system in your PHP project you will be very pleased to use this tiny-but-very-useful outputfilter that I made.

Smarty as you can read in its documentation has some extension points where you can create plugins into to extend its functionality. One of them are outputfilters, that allow us to operate on a template’s output, after the template is loaded and executed, but before the output is displayed.

So you can modify your final HTML code with those extentions point without a any pain.

Debugging PHP with XDebug and Komodo IDE

When you develop a very important web app it is pretty sure you will need debugging it. The best way to do this is using XDebug so in this article I am going to explain how to setup and use XDebug with Komodo IDE or Edit, but you can use it for Netbeans or Eclipse as well.

The first step is install XDebug in your system (I assume that you have already installed a LAMP server in your system).

Restore files and dirs from previous commits in Git

When I met git, I fall in love in the moment. You can read any apointments I wrote previously here, and here (in spanish) but today I’ll explain how to restore files and directories from previous commits that it was deleted by a mistake or intentionally in the past.

It’s quite easy to revert or reset a single file from history, but what about pulling an entire directory out of the history?

The solution is simple:

git checkout ID_of_commit -- /path/to/dir

This will restore the directory from the given “commit with ID” in the /path/to/dir.

But, let me show you a mistake I made in a commit into the gnome-system-tools repository:

Software’s life cycle

Software: do you write it like a book, grow it like a plant, accrete it like a pearl, or construct it like a building?

by Jeff Atwood

Page 3 of 3