This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::import('Vendor','tcpdf/tcpdf'); | |
class XTCPDF extends TCPDF | |
{ | |
var $xheadertext = null; | |
var $xheadercolor = array(255, 255, 255); | |
var $xfootertext = null; | |
var $xfooterfont = PDF_FONT_NAME_MAIN ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install APPLICATION_NAME //Install an application | |
sudo apt-get remove APPLICATION_NAME //Remove an application | |
sudo apt-get update //Update the system | |
sudo apt-get upgrade //Upgrade the system | |
killall APPLICATION_NAME //terminates an application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Singleton | |
{ | |
public static function classInstance() | |
{ | |
static $instance = null; | |
if (null === $instance) { | |
$instance = new static(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MagicClass | |
{ | |
/** | |
* @var | |
* | |
* Declaring two private variable. | |
*/ | |
private $myName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @return mixed | |
* | |
* This is array will output array (ascending and descending order) according to KEY | |
*/ | |
function sortArray() | |
{ | |
$funcArgument = func_get_args(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array (size=5) | |
0 => | |
array (size=2) | |
'name' => string 'Orange' (length=6) | |
'price' => string '12' (length=2) | |
1 => | |
array (size=2) | |
'name' => string 'Mango' (length=5) | |
'price' => string '10' (length=2) | |
2 => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MagicClass | |
{ | |
public $classDetails = 'This is simple basic class for magic to understand magic method'; | |
public $yourID; | |
public $yourName; | |
protected $isDBConnected; | |
protected $isDataStored; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery.li.scroller.js"></script> | |
<style type="text/css"> | |
ul.newsticker { | |
position: relative; | |
left: 750px; | |
font: bold 10px Verdana; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You may add here your | |
# server { | |
# ... | |
# } | |
# statements for each of your virtual hosts to this file | |
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function userCountByLesson() | |
{ | |
$lesson = $this->find( | |
'all', | |
array( | |
'recursive' => -1, | |
'fields' => array('COUNT(`id`) AS lessonTaken', 'created_for', 'created_by'), | |
'group' => 'Lesson.created_for' | |
) |