Skip to content

Instantly share code, notes, and snippets.

@JackNoordhuis
JackNoordhuis / AsyncPoolStartClosures.php
Last active February 10, 2020 10:33
Script plugin for testing PocketMine async worker start closures.
<?php
/**
* @name AsyncPoolStartClosures
* @main jacknoordhuis\test\AsyncPoolStartClosures
* @version 1.0.0
* @api 4.0.0
* @author Jack Noordhuis
*/
@JackNoordhuis
JackNoordhuis / TestAsyncPoolInitClosures.php
Created February 9, 2020 07:01
Script plugin for testing PocketMine async worker init closures.
<?php
/**
* @name TestAsyncPoolInitClosures
* @main jacknoordhuis\test\TestAsyncPoolInitClosures
* @version 1.0.0
* @api 4.0.0
* @author Jack Noordhuis
*/
@JackNoordhuis
JackNoordhuis / phpstan-pm.sh
Last active January 11, 2020 14:12
Bash script for running phpstan on pocketmine plugins.
#!/bin/sh
PHPSTAN_CONFIG="/pocketmine/phpstan.neon"
ROOT_PATH="$PWD"
VERSION="4"
while getopts "c:p:v" OPTION 2> /dev/null; do
case ${OPTION} in
c)
PHPSTAN_CONFIG="/source/$OPTARG"
@JackNoordhuis
JackNoordhuis / keybase.md
Created October 23, 2019 16:52
keybase.md

Keybase proof

I hereby claim:

  • I am jacknoordhuis on github.
  • I am jacknoordhuis (https://keybase.io/jacknoordhuis) on keybase.
  • I have a public key ASAbo6VtkOF8twN19vycoGWZsu2CL_mtRASrtEtfrHKGdgo

To claim this, I am signing this object:

@JackNoordhuis
JackNoordhuis / EnderChest2Chest.py
Created August 20, 2019 17:01
Filter for converting ender chests to chests in mcedit.
from pymclevel import TAG_Int, TAG_Compound, TAG_List, TAG_String
displayName = "EnderChest2Chest"
inputs = (
(
"Converts ender chests to chests.", "label"
),
)
@JackNoordhuis
JackNoordhuis / phpbrew-pmmp.sh
Last active April 4, 2019 12:18
Compile a PocketMine-MP compatible php binary with phpbrew.
PHP_VERSION="7.3.3"
[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
#
# Execute the compile command
#
phpbrew install -j 12 $PHP_VERSION +neutral -- \
--with-curl="$(brew --prefix curl)" \
--with-zlib="$(brew --prefix zlib)" \
@JackNoordhuis
JackNoordhuis / Link.vue
Created March 6, 2019 10:18
Laravel welcome landing page recreated in vue.js and tailwind css
@JackNoordhuis
JackNoordhuis / enum_ide_helper.php
Last active March 2, 2019 14:36
Enum IDE helper example
<?php
/** @noinspection ALL */
// @formatter:off
/**
* A helper file for php-enums, to provide autocomplete information to your IDE.
* Generated on 2019-03-02 14:35:54.
*
* This file should not be included in your code, only analyzed by your IDE!
@JackNoordhuis
JackNoordhuis / task-examples.php
Created February 15, 2019 12:24
Some PocketMine-MP task examples
<?php
namespace jacknoordhuis\example;
use pocketmine\plugin\PluginBase;
use pocketmine\scheduler\ClosureTask;
class RepeatingTaskExample extends PluginBase{
public function onEnable(){
@JackNoordhuis
JackNoordhuis / enable-pdo.patch
Last active September 24, 2019 10:55
Info on how to compile pmmp's php scripts with pdo enabled
diff --git a/compile.sh b/compile.sh
index 0b8fc71..95d09c5 100755
--- a/compile.sh
+++ b/compile.sh
@@ -809,11 +809,10 @@ $HAS_POCKETMINE_CHUNKUTILS \
--disable-xmlwriter \
--disable-cgi \
--disable-session \
---disable-pdo \
--without-pear \