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" }, |
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 | |
/** | |
* A class wrapper for PECL Libevent [http://www.php.net/manual/en/book.libevent.php] | |
* @author Paul Thrasher [http://paulthrasher.com/] 1/17/11 | |
**/ | |
/** | |
* // an example func that just exits | |
* function handler_func($fd, $events, $arg){ $arg[1]->loopexit(); }; |
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 | |
function http_get($host) { | |
// create event base | |
$base_fd = event_base_new(); | |
// create a new event | |
$event_fd = event_new(); | |
// resource to be monitored |
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 | |
// https://github.com/nikic/PHP-Parser/blob/master/lib/PhpParser/NodeVisitor.php | |
use PhpParser\Node; | |
use PhpParser\Node\Stmt; | |
class MyNodeVisitor extends PHPParser_NodeVisitorAbstract { | |
public $internal = array(); | |
public $replacements = array(); |
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 | |
require_once('attachment.class.php'); | |
/** | |
* Fast Mime Mail parser Class using PHP's MailParse Extension | |
* @author gabe@fijiwebdesign.com | |
* @url http://www.fijiwebdesign.com/ | |
* @license http://creativecommons.org/licenses/by-sa/3.0/us/ | |
* @version $Id$ |
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
{ | |
"require": { | |
"glenscott/url-normalizer" : "dev-master" | |
} | |
} |
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
#!/usr/bin/env php | |
<?php | |
$socket = stream_socket_server("tcp://127.0.0.1:8000", $errno, $errstr); | |
if (!$socket) { | |
die("$errstr ($errno)\n"); | |
} | |
$connects = array(); |
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 | |
function parseRawHttpRequest(array &$arrayData) { | |
$input = file_get_contents('php://input'); | |
preg_match('/boundary=(.*)$/', $_SERVER['CONTENT_TYPE'], $matches); | |
if (!count($matches)) { | |
// parse_str(urldecode($input), $arrayData); | |
parse_str($input, $arrayData); |
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 | |
/* This is daniel664's karma bot, fixed and stabilised by goeo_. | |
* It was a w_b_e fork anyway | |
*/ | |
set_time_limit(0); | |
error_reporting(0); | |
date_default_timezone_set('Europe/Istanbul'); | |
$server = "irc.freenode.org"; | |
$nick = "jbqakarmabot"; |
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(!file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])){ | |
$_GET['_url'] = $_SERVER['REQUEST_URI']; | |
} | |
return false; |