Skip to content

Instantly share code, notes, and snippets.

View bobmagicii's full-sized avatar
🤌

Bob Magic II bobmagicii

🤌
View GitHub Profile
<?php
$this->set_blinking(true);
Gtk::timeout_add(3000,function(){
$this->set_blinking(false);
return false;
});
<?php
class Bool {
// Bool - a class.
// handles types of Boolean nature.
// understands literal strings suchas "yes" or "true"
// "true" hayhaps be true, whilst "false" be not false, truely.
public function __construct($input);
public function __invoke();
<?php
public function SetText($text) {
$this->Text;
return $this;
}
@bobmagicii
bobmagicii / gist:9736424
Created March 24, 2014 08:36
3am... am i just tired... or...
echo "<pre>";
print_r($this->ErrorRoutes);
print_r($this->ErrorRoutes[404]);
echo "</pre>";
Array
(
[403] => Routes\Error\Forbidden
[404] => Routes\Error\NotFound
)
<?php
// tested on php 5.4.4 on freebsd
// tested on php 5.5.9 on windows
// rename the error routes to e403 and e404, and this does not happen.
// -or-
// $array = get_object_vars($object->ErrorRoutes);
$json = <<< 'EOF'
@bobmagicii
bobmagicii / phase1.php
Last active August 29, 2015 14:00
testing if unserialize kicks the autoloader
<?php
require(sprintf(
'%s/vendor/autoload.php',
dirname(dirname(__FILE__))
));
// create an object known to be dynamically loaded. Nether\Object is a PSR
// autoloaded class and not defined in the composer classmap.
<?php
$nslist = $this->Scanner->getNamespaces();
foreach($nslist as $ns) {
if(strpos($ns->getName(),$what) === 0) {
$this->NoticeNamespace($ns->getName());
}
<?php
/*
$ php codecept.phar run
Trying to test set flags oning (DMA_Object_SetFlags_Test::testSetFlagsOning) Ok
Trying to test set flags offing (DMA_Object_SetFlags_Test::testSetFlagsOffing) Ok
Trying to test set flags toggling (DMA_Object_SetFlags_Test::testSetFlagsToggling) Ok
*/
class DMA_Object_SetFlags_Test extends Codeception\TestCase\Test {
static function Search($opt=null) {
/*//
@todo cache search results for a little bit.
@argv object Options
@return object
perform a search of objects with various properties. if called from a child
class then that type will be automatically forced and relevant tables
automatically joined.
//*/
static function Search_Extend_Options($opt) {
$opt = parent::Search_Extend_Options($opt);
if(!property_exists($opt,'Email')) $opt->Email = false;
return $opt;
}
static function Search_Extend_Filters($s,$opt) {
parent::Search_Extend_Filters($s,$opt);