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 | |
// PHP 5.6 | |
usort($array, function($a, $b) { | |
if ($a == $b) { | |
return 0; | |
} | |
return ($a < $b) ? -1 : 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 | |
namespace Fullybaked; | |
use FileNotFound; | |
/** | |
* File class | |
* | |
* Simple wrapper for native methods file_get_contents and file_put_contents | |
* in an OOP context and with some useful methods for getting information about | |
* a given File |
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
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; |
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 | |
/** | |
* Component handles various types of file upload | |
* | |
* @author Dave Baker | |
* @copyright Dave Baker / Fully Baked 2012 | |
* @link www.fullybaked.co.uk | |
*/ | |
class UploadComponent extends Component { |
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
<? | |
/** | |
* Returns the breadcrumb trail as a sequence of »-separated links. | |
* | |
* @param string $separator Text to separate crumbs. | |
* @param string $startText This will be the first crumb, if false it defaults to first crumb in array | |
* @param mixed $startPath Url for the first link in the bread crumbs, can be a string or array | |
* @param boolean $escape Escape the content of the link text, set to false if passing an image in | |
* @return string Composed bread crumbs | |
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper |
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
/* Test SCSS File */ | |
/* Variables & Calculations */ | |
$blue: #3bbfce; | |
$margin: 16px; | |
.content-navigation { | |
border-color: $blue; | |
color: | |
darken($blue, 9%); |
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
// open athens dates come from a date picker text input in the view, in the format dd-mm-yyyy | |
<?= $this->Form->input('openathens_start_date, [ | |
'type' => 'text', | |
'class' => 'datepicker']);?> | |
<?= $this->Form->input('openathens_end_date, [ | |
'type' => 'text', | |
'class' => 'datepicker']);?> | |
// in the Table | |
public function beforeMarshal(Event $event, \ArrayObject $data, \ArrayObject $options) |
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 | |
// data controller | |
public function get_data() | |
{ | |
$data = [ | |
'item' => $this->getDataFromSomewhere(), | |
'min' => 0, | |
'max' => 10 | |
]; |
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 | |
public function findByFullName($search_term) { | |
$users->find() | |
->where(['CONCAT(UserProfiles.first_name, " ", UserProfiles.lastname)' => $search_term]); | |
->contain(self::$applicant_contain) | |
->order(['Users.primary_role' => 'DESC', 'Users.modified' => 'DESC']) | |
->limit(25); | |
} |
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
select count(DISTINCT project_id), sum(amount), user_id | |
from payments | |
group by user_id | |
order by sum(amount) desc; |
NewerOlder