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 | |
$fp = fsockopen('127.0.0.1', 6379, $errno, $errstr, 30); | |
$data = array(); | |
if (!$fp) { | |
die($errstr); | |
} else { | |
fwrite($fp, "INFO\r\nQUIT\r\n"); | |
while (!feof($fp)) { |
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 | |
$calibration = benchmark(function() { }); | |
$benchmark = benchmark(function() { | |
sleep(1); | |
}); | |
echo "Calibration run: ".number_format($calibration)."/sec\n"; | |
echo "Benchmark run: ".number_format($benchmark)."/sec\n"; | |
echo 'Approximate code execution time (seconds): '.number_format((1/$benchmark) - (1/$calibration), 10); |
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 | |
function shuffleBalls(): array | |
{ | |
$balls = range(1, 90); | |
shuffle($balls); | |
return $balls; | |
} |
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
{ | |
"name": "Ben Longden" | |
} |
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 | |
$array = | |
[ 'forename' => 'Ben' | |
, 'lastname' => 'Longden' | |
, 'company' => 'Inviqa' | |
, 'purpose' => 'Trying to decide if this sucks or not' | |
]; |
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
Verifying that +blongden is my blockchain ID. https://onename.com/blongden |
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
<html> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script type="text/javascript" src="http://ricostacruz.com/jquery.transit/jquery.transit.min.js"></script> | |
<script type="text/javascript"> | |
$.fn.flip = function(back, duration) { | |
duration = duration || 200; | |
front = this; | |
$(back).css({transform: 'rotateY(270deg)'}); |
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
class Fdrop_Plugin_AcceptHandler extends Zend_Controller_Plugin_Abstract | |
{ | |
protected function getQuality($media) | |
{ | |
$data = explode(";q=", $media); | |
return isset($data[1]) ? $data[1] : 1.0; | |
} | |
protected function sortMediaByQuality($a, $b) | |
{ |
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": { | |
"php": ">=5.4.0", | |
"elasticsearch/elasticsearch": "~1.3" | |
} | |
} |
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
<?xml version="1.0"?> | |
<resource> | |
<total>2</total> | |
<resource rel="errors" logref="50"> | |
<link rel="help" href="http://.../"/> | |
<message>"username" field validation failed</message> | |
</resource> | |
<resource rel="errors" logref="55"> | |
<link rel="help" href="http://.../"/> | |
<message>"postcode" field validation failed</message> |
NewerOlder