"Rajin Berkerja, Rajin Bercakap" – Bagus
"Rajin Berkerja, Malas Bercakap" – Kena Buli
"Malas Berkerja, Rajin Bercakap" – Wayang Cina
"Malas Berkerja, Malas Bercakap" – Tak Guna
"Malas Berkerja, Suka Mengadu" – Lalat Hijau
"Malas Berkerja, Suka Ponteng" – Lebih Baik Berhenti
"Malas Berkerja, Suka Termenung" – Lebih Baik Mati
"Rajin Berkerja, Rajin Mengadu" – Kaki Bodek
quote by Royal Prof Ungku Aziz
Step 6, 7 & 8 are entirely optional
1) sudo yum install pcre-devel zlib-devel openssl-devel
2) mkdir ~/sources
3) cd ~/sources
4) wget http://nginx.org/download/nginx-0.9.5.tar.gz
5) tar -zxvf nginx-0.9.5.tar.gz
6) mv nginx-0.9.5.tar.gz nginx
7) cd nginx

[if gcc not available] yum install gcc
9) ./configure –sbin-path=/sbin/nginx –conf-path=/usr/local/nginx/nginx.conf –pid-path=/usr/local/nginx/nginx.pid –with-http_ssl_module –with-md5=auto/lib/sha1
10) make
11) make install
12) cd /usr/local/nginx/
13) vi nginx.conf
14) nginx

After almost 3 year using the old design, the team decide make a major facelift to the cookbook. They even put local cache function. kudos!
Ooh! Ahh! Google recently upgrade the image search.

New view on Google Image Search
More to fine on official Google Blog
Pernah guna fungsi goto? last time aku guna mcm 4-5 tahun dlu. sebab dulu PHP memang takde.
/* function lock */
function lock()
{
$file = fopen("file.txt","r+");
retry:
if(flock($file,LOCK_EX))
{
fwrite($file, "Success!");
fclose($file);
return 0;
}
else
goto retry;
}
loop dalam function. nice?
Kalau selalu guna if and else, langkah seterusnya mesti tahu ternary condition. ade alternative lain nak guna dalam CakePHP, contoh:
/* ife in cakePHP */
ife($condition, $true, $false)
jadi, kalau statement ternary tu cam ni:
/* ternary condition */
echo ($x)?'x = true':'x = false';
ble ubah jadi macma ni. mudah sket
/* replace ternary with ife in cakePHP */
echo ife($x, 'x = true', 'x = false');
urm.. dapat?
Kalau malas asik nak declare layout di cakephp, aku akan guna code macam ni.
/* before Render */
function beforeRender()
{
parent::beforeRender();
$this->layout = 'plugin';
....
}
lepas tu aku nak tukar stail layout, misalnya nak guna layout “ajax”. jadi aku declare macam ni..
/* children */
function children($id = null)
{
....
$this->layout = 'ajax';
}
tapi tak jadi!? kenape? perasan function beforeRender tu?
/* before filter */
function beforeFilter()
{
parent::beforeFilter();
….
$this->layout = ‘plugin’;
}
baru jadi! sebab beforeRender akan override balik variable sebelum render! sebab tu tak jadi.
Aku ada masalah nak buat link dari plugin page ke page biasa.
mula² jumpa cara macam ni..
$html->link(__(‘Home’, true), array(‘root’ => false, ‘plugin’ => false, ‘controller’ => ‘users’, ‘action’ => ‘home’), array(‘class’ => ‘menu’));
tapi still tak menjadi.. aku check cake version betul.. 1.2.5
jadi.. setelah mencari² cara macam mana nak reroute balik (kejalan yang benar) siap bukak source asal. rupa² nyer kena guna null. jadi seperti ni.
$html->link(__(‘Home’, true), array(‘root’ => false, ‘plugin’ => null, ‘controller’ => ‘users’, ‘action’ => ‘home’), array(‘class’ => ‘menu’));
kenapa false tak ok? pelik tapi benar