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
import java.util.List; | |
import javax.smartcardio.*; | |
// VARIATION OF: | |
// http://ludovicrousseau.blogspot.com/2010/06/pcsc-sample-in-java.html | |
// The included commands are specific to acr122u reader / writer for Mifare Classic 1k tags | |
public class pcsc { | |
public static void main(String[] args) { |
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 | |
$key = 'SECRET_ACCESS_KEY_ID'; | |
$accesskeyid='ACCESS_KEY_ID'; | |
$expires = time()+60; // URL expires in 60 seconds | |
$stringtosign = "GET\n\n\n{$expires}\n/BUCKET_NAME/PATH/TO/RESOURCE.EXT"; | |
$signature = urlencode(base64_encode(hash_hmac('sha1',$stringtosign,$key,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 | |
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 | |
/** | |
* 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 | |
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 | |
// 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
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 | |
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
<?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 | |
error_reporting(0); | |
define('MONITOR_INTERVAL', 60); | |
$monitors = [ | |
['127.0.0.1',25,80,110] | |
]; |