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 | |
define('CLIENT_PORT', 10000); | |
define('HOST','127.0.0.1'); | |
define('SERVER_PORT', 10001); | |
gc_enable(); | |
$loop = React\EventLoop\Factory::create(); |
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 | |
define('SCRIPT_MEMORY_CONSUMPTION', memory_get_usage(true)); | |
gc_enable(); | |
/** | |
* we might call gc_collect_cycles if | |
* memory_get_usage >= original memory * threshold | |
*/ |
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 | |
error_reporting(0); | |
define('MONITOR_INTERVAL', 60); | |
$monitors = [ | |
['127.0.0.1',25,80,110] | |
]; |
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 | |
class ReactStream { | |
private $components; | |
private $position; | |
private $queue; | |
function stream_open($path, $mode, $options, &$opened_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
<?php | |
include('EventTrait.php'); | |
class EventLoop | |
{ | |
use EventTrait; | |
private $base; | |
private $events; |
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
How to do inferred dependency injection in PHP [similar to concept employed by AngularJS] | |
- http://php.net/manual/en/function.parsekit-func-arginfo.php |
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 | |
// If you don't want to depend on HTTP client to serialize POST body into URI | |
// encoded format | |
// ** For Example: AngularJS doesn't natively POST the same way jQuery does. | |
$post = json_decode(file_get_contents('php://input'), true); |
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 | |
for($x=0;$x<strlen($argv[1]);$x++){ | |
$tokens[] = getNextToken(substr($argv[1],$x),$x); | |
} | |
print_r($tokens); | |
function getNextToken($input,&$prefix){ |
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 | |
/** | |
* Phreezer project page: | |
* https://github.com/cameronjacobson/Phreezer | |
*/ | |
class Vehicle | |
{ | |
public function __construct(){} |
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 | |
if(isset($_GET['success'])){ | |
echo 'done'; | |
exit; | |
} | |
$policy = base64_encode(str_replace(array("\r","\n"),"",'{ "expiration": "2023-01-01T12:00:00.000Z", "conditions": [ | |
{"acl": "public-read" }, | |
{"bucket": "MYBUCKET" }, |
OlderNewer