Skip to content

Instantly share code, notes, and snippets.

View williamtdr's full-sized avatar
🛴
hi!

William Teder williamtdr

🛴
hi!
View GitHub Profile
## MCRegion to Anvil converter
##
## to use:
##
## Download http://libredstone.org/libredstone-0.0.0.tar.bz2, run
## ./configure.sh
## and
## make
## Make sure you have python and numpy installed. Then download
## this script into ./bindings/, cd into there, and run:
@domenic
domenic / promises.md
Last active April 1, 2025 01:54
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@shoghicp
shoghicp / worldFixer.php
Last active July 4, 2018 12:16
This code will: Recreate lost signs, furnaces and chests, and remove invalid or corrupt tile entities from a world.
<?php
$world = $this->getServer()->getDefaultLevel();
$radius = 80;
$total = (($radius * 2) + 1) ** 2;
$count = 0;
for($chunkX = -$radius; $chunkX <= $radius; ++$chunkX){
for($chunkZ = -$radius; $chunkZ <= $radius; ++$chunkZ){
$chunk = $world->getChunk($chunkX, $chunkZ, false);
if($chunk instanceof \pocketmine\level\format\FullChunk and $chunk->isPopulated()){
$tiles = [];