You are here:

Laman Web Aziz

Kisah Bela Anjing

Print PDF

2 year back, saya pernah terdengar sahabat baik saya berkata. i quote "Bela Anjing, Malaikat tak masuk rumah" 
sebelum saya tulis perkara asal usul Hukum ini, mari kita baca komen "awek samurai"

"Malaikat tak masuk rumah ..... malaikat bagi rezeki pun tak nak masuk .... sume malaikat takkan masuk rumah .... so paham2 lah kalo ko hidup tanpa doa2 dari malaikat sekian makaseh ... haram tetap haram jgn sesekali menghalal kan yang haram"

kat salah satu blog. seorang manusia muslim yang membela anjing.

dan saya pernah lihat video seorang perempuan berjalan di sekitar kandang khinzir dan memegang, membersihkan kandang ini.

lihat video ini untuk huraian lebih lanjut atas hukum apa yg berlaku.

Image Components

Print PDF

Finally i got the Watermark component to work on CakePHP
this was based on the cakephp bakery article here

its a very powerfull component where it have all the capability of most image processing software & its will be executed by simple calling the components methods

 

var $components = array("Image");

$img=$this->Image->open('./img/zombie_4eae9dda2867c.png');

if($img)
{
$_autosave='';
$this->Image->watermark('rb','./img/mg.png','','');
//saveAs($filename,$quantity=80,$smooth=-1,$dispose_onsaved=true)
$this->Image->saveAs('./img/zombie1.png',1,1);
$img->close();
}

 

Complete implementation of Image Upload,
WaterMark & Facebook Upload snippets

$img=$this->Image->open('.'.$saveddata['Product']['photo']);
echo debug($img);         

if($img)
{
$_autosave='';
$this->Image->watermark('rb','./img/mg.png','',0);
//saveAs($filename,$quantity=80,$smooth=-1,$dispose_onsaved=true)
$this->Image->saveAs('.'.$saveddata['Product']['photo']);
$img->close();

echo debug($this->Connect->Image('.'.$saveddata['Product']['photo'],$saveddata['Product']['title'],'This is an uploaded image message'));
}

 

reCAPTCHA

Print PDF

 

CakePHP steps on enabling reCAPTCHA on cakephp

 

  1. Download https://github.com/tbsmcd/recaptcha_plugin
  2. Extract & Rename final folder to 'recaptcha_plugin' and place it into [your root]/app/plugins.
  3. Get 'recaptchalib.php' from Google code, and put it on [your root]/app/plugins/recaptcha_plugin/vendors.
  4. sign up your key from google if you never have one https://www.google.com/recaptcha/admin/create
  5. Update reCAPTCHA key here [your root]\app\plugins\recaptcha_plugin\config\key.php
    $config = array( 
    'Recaptcha' => array( 
    'Public'  => 'YOUR_RECAPTCHA_PUBLIC_KEY', 
    'Private' => 'YOUR_RECAPTCHA_PRIVATE_KEY', 
    ), 
    );
  6. include the components & helper into your controller (Not App_controller.php).
    This will create use to create reCAPTHA to your view

    public $components = array('RecaptchaPlugin.Recaptcha'); 
    public $helpers = array('RecaptchaPlugin.Recaptcha');

  7. add these two code to the location you want to show the reCAPTCHA. (in the xxx.ctp)

    <?php
    echo $this->Recaptcha->show();  // Display reCAPTCHA widget. 
    echo $this->Recaptcha->error(); // Show validation message of reCAPTCHA.
    ?>


  8. try your site. here is an example view of my add.ctp from users_controller.php. (which is using bake)

 

Upload with Cake PHP

Print PDF

There is something i need to acknowledge of using cakephp that make it harder to get things done vs doing it with php,

the understanding.

although cakephp is really simple to use & it simplify almost 95% of php coding,
it require a very strong fundemental of php, OOP & most importantly cakephp structure & how things work.

upload a file is quite easy to find resource from php site.
but getting it done in php require additional understanding. (inthis case behaviour)

this is my first time using behaviour in cakephp & its for uploading file.

this was not created by me.
This is the original path to the git location

but there is something missing from the manual which is the noob step. & i would like to write it here as my reference *as well as visitors

1. download from here.
2. Rename to uploadable.php
3. upload to app/models/behaviours/
4. add this to your model (which is having upload feature)

/*There is a field validaiton for photo which its accept & the path it will upload it*/

public $actsAs = array(
'Uploadable' => array(
'default' => array('accept' => false),
'photo' => array(
'accept' => array(
'image/jpeg' => array('jpg', 'jpeg'),
'image/gif' => array('gif'),
'image/png' => array('png')
),
'path' => '/uploaded/',
'prefix' => ''
)
)
);

5. add form to submit a file on your view.

/*
Recipe is the model name
Photo is the field name to save the image location
*/

		echo $this->Form->create('Recipe', array('enctype' => 'multipart/form-data')); 
		echo $this->Form->input('photo', array('type' => 'file'));
		echo $this->Form->end(__('Submit',true));

6. Test to upload.




 

Perform CPR to your self

Print PDF

Symptom : Severe Pain in chest & radiate to arm & into your jaw

* YOU Only have 10 seconds before losing conscious

What to do:

START COUGHING REPEATEDLY AND VERY VIGOROUSLY
A DEEP BREATH SHOULD BE TAKEN BEFORE EACH COUGH,
THE COUGH MUST BE DEEP AND PROLONGED,
AS WHEN PRODUCING SPUTUM FROM DEEP INSIDE THE CHEST.
A BREATH AND A COUGH MUST BE REPEATED
ABOUT EVERY TWO SECONDS WITHOUT LET-UP
UNTIL HELP ARRIVES, OR UNTIL THE HEART IS FELT
TO BE BEATING NORMALLY AGAIN.

WHY:

DEEP BREATHS GET OXYGEN INTO THE LUNGS AND COUGHING
MOVEMENTS SQUEEZE THE HEART AND KEEP THE BLOOD
CIRCULATING. THE SQUEEZING PRESSURE ON THE HEART
ALSO HELPS IT REGAIN NORMAL RHYTHM. IN THIS WAY,
HEART ATTACK VICTIMS CAN GET TO A HOSPITAL

 

 

 

 

 

ARTICLE PUBLISHED ON N.º 240 OF JOURNAL OF GENERAL HOSPITAL ROCHESTER


Back to top

Copyright © Laman Web Aziz 2012

Template by Free Joomla Templates & Projektowanie stron Szczecin.