Skip to content

Instantly share code, notes, and snippets.

@shoghicp
shoghicp / Comparator.php
Last active July 26, 2020 21:36
Minecraft PE .lst Information Extractor to obtain Protocol Information and Compare Versions
<?php
define("COMPARATOR_VERSION", "0.1");
ini_set("memory_limit", "512M");
$node1 = json_decode(@file_get_contents($argv[1]), true);
if($node1 == ""){
echo "Provide a valid json file produced by the Extractor".PHP_EOL;
exit(1);
}
$node2 = json_decode(@file_get_contents($argv[2]), true);
@shoghicp
shoghicp / IO.php
Created January 12, 2013 12:24
async PHP Console I/O, Needs pthreads https://github.com/krakjoe/pthreads/
<?php
if(!extension_loaded("pthreads") and @dl((PHP_SHLIB_SUFFIX === "dll" ? "php_":"") . "pthreads." . PHP_SHLIB_SUFFIX) === false){
trigger_error("Unable to find pthreads extension", E_USER_ERROR);
exit(1);
}
function kill($pid){
$uname = strtoupper(php_uname("s"));
@dazld
dazld / perlin.php
Created March 23, 2012 18:59
PHP Perlin Noise Class
//This is a port of Ken Perlin's "Improved Noise"
// http://mrl.nyu.edu/~perlin/noise/
// Originally from http://therandomuniverse.blogspot.com/2007/01/perlin-noise-your-new-best-friend.html
// but the site appears to be down, so here is a mirror of it
class Perlin {
var $p, $permutation, $seed;
var $_default_size = 64;