Friday, 12 September 2008

My Firefox Developer Plugins

These are my Developer Addons

Enjoy

Thursday, 11 September 2008

PHP and mail

On the server, you need to install sendmail. If you found you duff configuration and you had to change your hostname details. You wonder how to reconfigure sendmail? You can reconfigure it by running...
sendmailconfig

My Linux Shell Cheatsheet

Find total number of lines in a programming project recursively.
cd /to/some/project/folder/with/loads/of/subfolders
wc -l `find . -name *.php`

Wednesday, 3 September 2008

Dojo/JS Error: [somevariable] is not defined

Error: some variable is not defined
Source File: bla.php?sadf
Line: 360

Make sure you name your widgets in the HTML with "jsId". For example:

<select name="somevariable" jsId="somevariable" /></select>

Tuesday, 2 September 2008

Dojo/JS Error: unterminated string literal

As of Dojo version 1.1.1, the nice debug console Dojo provides does not properly show where abouts the error occured. So make sure you bring up the Web browser's javascript console also.

Don't forget to clear the javascript console log and re-run your page.

Example Error

The Quotes, at around t=i&id='????' is causing the trouble. Basically cuasing the intoNode to break.
dojo.xhrGet(intoNode('ajaxingredientlist', '/ajax/categories/?ajax=true&mode=l&t=i&id='????'))

Monday, 1 September 2008

PHP: Cannot use object of type stdClass

When handling object, you have to remember to retieve LIKE an object, NOT an like array style.

Example Object retrieval:
$varName->someThingToGet


PHP Example
Make sure you just use

echo $response->TransactionID;
NOT
echo $response['TransactionID'];

Zend Framework
[ ZEND_DB Example ]
When handling You must remember to set the db adaptor to fetch object, so anything returned will fetched as a proper object.

$this->db->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->db->fetchRow($select);
echo $result->columnNameToFetch;