Archive for May, 2008

[Script-Fu] portfolio

I did it again. For the photo training I’m attempting to, I need to show at the final year test a portfolio for the reportage subject.

I have to show 30 photos paged in a portfolio. So in order to speed up the pagination work, I did a gimp script.

This will process the opened image and generate a new file with the paginated photo and a caption.

Here is the code; pdf as usual damn wordpress.

Again, I’m not proof in script-fu so if you encounter something wrong or that can be done better, use the comments :)

Comments

[emacs] toggle a buffer in read only

I’m a bit abstracted and usually works with a lot of opened files. So it happens sometimes that in the rush of job i ended editing a file instead of another.

I’m also usual to open existing files I wrote in order to get some hints. And I could edit them for error. To avoid this I usually use my preferred editor functionality to set a buffer as read only, so it’s not possible to write inside it. How?

M-x toggle-read-only

Easy! :)

Comments

[CakePHP] Alias in the url. Take 2

Some days ago, I posted about having dynamic URL aliases with cake-php 1.1.18. In that post I used the AppError object trapping the missingAction error.

When I was ready for production environment, during tests I wondered that the AppError is ignored when core debug level is set to 0. While I’m asking about the utility of this behavior, I asked in the list and searched for a solution.

One solution could be to take the __construct method from the ErrorHandler, removing the Configure::read() test and paste it into the AppError::__construct() without calling the parent::__construct(). But in this way if some new feature, fixes, etc. is distributed within that method you’ll probably miss it until you monitor each release.

Finally I opted for useing the routes.php file mapping each action and then mapping the “missing action” to the controller::view() action and the manage the code inside it. Here is a PDF with an extract of the code.

Comments