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 | |
Trait MethodDelegator | |
{ | |
private $roles = array(); | |
private $method_map = array(); | |
public function delegate($class) | |
{ |
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 | |
Trait MethodDelegator | |
{ | |
private $roles = array(); | |
private $method_map = array(); | |
public function delegate($class) | |
{ |
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 Model_User extends Model { | |
public function initialize() | |
{ | |
$this->pk_fields = [ 'id' ]; | |
$this->add_fields([ | |
'id' => 'int4', | |
'account_id' => 'int4', |
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
var Todo = Backbone.Model.extend({ | |
defaults: { | |
title: '', | |
completed: false | |
} | |
}); | |
var TodosCollection = Backbone.Collection.extend({ | |
model: Todo | |
}); |
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 Test { | |
public $init = FALSE; | |
public function __construct() { | |
echo "Initialized Test"; | |
$this->init = TRUE; | |
} | |
} |
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 | |
usort($products['mp'], function ($a, $b) { | |
return $a['priority'] - $b['priority']; | |
}); | |
// VS | |
usort($products['mp'], function ($a, $b) |
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 defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* Simplified Kohana Auth version with NO password hashing | |
*/ | |
class Auth { | |
/** | |
* @var Auth Static instance | |
*/ | |
protected static $_instance; |
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
# github.com/rafi i3status config | |
# i3status configuration file | |
# see "man i3status" for documentation. | |
# It is important that this file is edited as UTF-8. | |
# The following line should contain a sharp s: | |
# ß | |
# If the above line is not correctly displayed, fix your editor first! |
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 | |
$preferences = [ 'c', 'e' ]; | |
$params = []; | |
foreach ($preferences as $setting) | |
{ | |
switch($setting) | |
{ | |
case 'a': |
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 | |
/** | |
* Recursively compute conditions against existing data, supports $or (like Mongo) | |
* For example: | |
* { | |
* "$or": [ | |
* { "foo": true }, | |
* { "bar": true, "baz": true } | |
* ], |