Skip to content

Instantly share code, notes, and snippets.

@krakjoe
krakjoe / pthreads.md
Last active August 30, 2023 18:30
pthreads.md

Multi-Threading in PHP with pthreads

A Brief Introduction to Multi-Threading in PHP

  • Foreword
  • Execution
  • Sharing
  • Synchronization
  • Pitfalls
@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;
@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 / banned.md
Last active May 20, 2018 19:27
Ban List of #mcpedevs and #pocketmine

#mcpedevs

  • LoveJoy: (aka xXDARK_KNIGHTXx, *lovejoy, lovejoy1598, DJ_HeRtBrEaK, mcpelover +more) Swearing, pirating MCPE, Spamming, Spamming Quote bot, Multiple ban evasion. by Intyre, shoghicp
  • KevinWang_China: (aka VanishedKevin) Malicious plugin creation, spamming, Ban Evasion. by shoghicp
  • Xiang: (aka NgJinXiang) Spamming questions. by Intyre
  • nikony: Spamming pacman. by Intyre
  • shader: (aka Shad-Bot, proCmd) Insulting, advertising, ban evasion related logs. by shoghicp
  • TrilogiForce: Spamming, threatening the team. by Brandon15811
  • JasperBeastHD: (aka JasperHD, JassperBeastHD) Insulting moderators, evading ban. some related logs. by Brandon15811
  • DarkDemon101: Pinging main developers needlessly, asking to be admin/tester/co-owner after being told to stop. by shoghicp
  • Striker209_MPE: Spammin
@shoghicp
shoghicp / Translations.php
Last active September 28, 2017 20:13
PocketMine Realms login translations
<?php
/*
UTF-8 encoded.
UPPERCASE words are replaced with data, do NOT modify that, only move it to the correct place.
Words like PocketMine, Mojang, Minecraft, Pocket Edition and Mine Pocket shouldn't be translated.
Don't modify HTML tags (exception: text inside the tags and NOT in UPPERCASE)
Translations completed: English (shoghicp), Spanish (shoghicp), Standard Chinese (HAZ_ljyloo), Dutch (Intyre), Japanese (Omattyao), Russian (Alexey Egoshin), French (symonium), German (Xmoe)
Translations being publicly checked: Vietnamese (Phuocpeter19), Italian (ceppopipc1999), Serbian (xXStefoXx)
Translations in progress: Korean (bigswbigsw), Irish (A9_0Z), Turkish
@shoghicp
shoghicp / MCHead.php
Last active May 6, 2016 06:55
Draw a Canvas of a Minecraft skin, with the hat.
<?php
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DEFLATEPacket mixed protocol encapsulation for Minecraft: Pocket Edition

This protocol aims to use less bandwidth sending big packets / chunks of smaller packets compressed using DEFLATE. It works encapsulating raw packets into this protocol, without modifying them. It follows a mixed approach, letting normal packets work and handling compressed packet seamlessly. Both parties must support this protocol, so a Handshake system exists.

All numbers are Big-endian

Packet Structure

| Packet ID | Field Name | Type | Notes |

This file has been truncated, but you can view the full file.
'use strict';
var COMPILED = !0, goog = goog || {};
goog.global = this;
goog.DEBUG = !1;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a))
throw Error('Namespace "' + a + '" already declared.');
           -
         /   \
      /         \
   /   PocketMine  \
/          MP         \
|\     @shoghicp     /|
|.   \           /   .|
| ..     \   /     .. |
| .. | .. |
@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"));