This file contains 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
App::error(function(Exception $exception, $code) | |
{ | |
Log::error($exception); | |
if (Config::get('app.debug') == false) { | |
return Redirect::route('404'); | |
} | |
}); |
This file contains 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 | |
$previousUrl = $_SERVER['HTTP_REFERER']; | |
$previousRoute = parse_url($previousUrl); | |
$previousRoute = $previousRoute['path']; | |
?> |
This file contains 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
app.filter('secondsToDateTime', [function() { | |
return function(seconds) { | |
return new Date(1970, 0, 1).setSeconds(seconds); | |
}; | |
}]) | |
html: | |
<b>{{seconds | secondsToDateTime | date:'HH:mm:ss'}}</b> |
This file contains 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
var myApp = angular.module('myApp', [], function ($interpolateProvider) { | |
$interpolateProvider.startSymbol('{kp'); | |
$interpolateProvider.endSymbol('kp}'); | |
}); |
This file contains 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 | |
$result = CustomerQuery::create()->filterByCreatedAt(array('min' => $startDate, 'max' => $endDate)) | |
->select(array('ID', 'Name', 'CreatedAt')) | |
->addGroupByColumn('DATE(created_at)') | |
->find(); | |
?> |
This file contains 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 | |
$products = array ( | |
1 => array( | |
'id' => 125, | |
'name' => 'The Breville One-Touch Tea Maker', | |
'slug' => 'breville-one-touch-tea-maker-BTM800XL', | |
'shortname' => 'The One-Touch Tea Maker', | |
), | |
2 => array( |
This file contains 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 | |
$string ="<?xml version='1.0'?> | |
<document> | |
<title>Forty What?</title> | |
<from>Joe</from> | |
<to>Jane</to> | |
<body> | |
I know that's the answer -- but what's the question? | |
</body> | |
</document> |
This file contains 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
; with sane limits | |
xdebug.var_display_max_depth = 5 | |
xdebug.var_display_max_children = 256 | |
xdebug.var_display_max_data = 1024 | |
; with no limits | |
; (maximum nesting is 1023) | |
xdebug.var_display_max_depth = -1 | |
xdebug.var_display_max_children = -1 |
This file contains 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 | |
$array = array('alias' => 'aliasOne', 'location_id' => 1); | |
$model = new Client(); | |
$model->fromArray($array, BasePeer::TYPE_FIELDNAME); | |
$model->save(); |
This file contains 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
install memcached | |
sudo apt-get install php5-memcached memcached | |
enable memcached module | |
sudo php5enmod memcached | |
restart php5-fpm | |
sudo service php5-fpm restart |