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 robots = new Array(); | |
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var Robot = function(robot) { | |
| }; | |
| Robot.prototype.start = function( ev ){ |
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
| //FightCode can only understand your robot | |
| //if its class is called Robot | |
| var alphaId; | |
| var cloneId; | |
| var bot = { | |
| cannon_rotation_direction : {}, | |
| target : {}, | |
| shoot : {}, |
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 | |
| /** | |
| * Adds to array functionality to fActiveRecord and fRecordSet | |
| */ | |
| class fORMtoArray | |
| { | |
| // The following constants allow for nice looking callbacks to static methods | |
| const extend = 'fORMtoArray::extend'; | |
| const reflect = 'fORMtoArray::reflect'; | |
| const toArray = 'fORMtoArray::toArray'; |
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 | |
| $hooks = array( | |
| 'post::__construct()', | |
| 'pre::delete()', | |
| 'post-begin::delete()', | |
| 'pre-commit::delete()', | |
| 'post-commit::delete()', | |
| 'post-rollback::delete()', | |
| 'post::delete()', | |
| 'post::loadFromIdentityMap()', |
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 FileNameFilter extends \FilterIterator { | |
| protected $exclude; | |
| public function __construct(\RecursiveIterator $iterator, $exclude) { | |
| parent::__construct($iterator); | |
| $this->exclude = $exclude; | |
| } | |
| public function accept(){ | |
| $item = $this->getInnerIterator()->current()->getFileName(); |
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 | |
| var_export(array_diff(get_defined_vars(), array(array()))); |
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 Page extends fActiveRecord{ | |
| protected function configure(){ | |
| fORM::registerHookCallback($this, 'post::validate()', 'Page::generateThumb'); | |
| fORMFile::configureFileUploadColumn($this, 'image', DOC_ROOT . '/uploads/page'); |
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 | |
| /** | |
| * Simple structure to allow optional getters and setters | |
| * | |
| */ | |
| namespace Drive\GridView; | |
| abstract class Base { |
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 | |
| /** | |
| * | |
| * Key : Value | |
| */ | |
| private $validConfigKeys = array('active'); | |
| private function parseConfigFile($file, $validConfigKeys = null){ | |
| $validConfigKeys = $validConfigKeys ?: $this->validConfigKeys; |
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 fArrayFilter { | |
| static public function filter($array, $conditions){ | |
| $results = array(); | |
| foreach($array as $key => $item){ | |
| $valid = fArrayFilter::checkConditions($item, $conditions); | |