Skip to content

Instantly share code, notes, and snippets.

View legoboy0215's full-sized avatar

Legoboy0215 legoboy0215

View GitHub Profile
@shoghicp
shoghicp / Rules.md
Last active November 23, 2020 21:53
Rules of channels #mcpedevs and #pocketmine on irc.freenode.net
@miguelmota
miguelmota / nodejs-directory-structure.md
Last active December 2, 2023 08:47
Node.js MVC directory structure example.
Node.js MVC directory structure example.
├── app
│   ├── controllers
│   │   ├── admin
│   │   │   ├── posts.js
│   │   │   └── users.js
│   │   ├── posts.js
│ │ ├── session.js

You want to override the tell command, that has also the w and msg aliases by default. The class that will override these commands is MyTellCommand (extends PluginCommand).

To do this, you've to set the original command in a state that allows it to be overriden. Also, aliases will be registered directly, but since all the work was done for the first registration, it's pretty simple.

//We are in the context of a plugin
<?php
$world = $this->getServer()->getDefaultLevel();
$radius = 136;
$total = (($radius * 2) + 1) ** 2;
$count = 0;
$bList = clone \pocketmine\block\Block::$list;
$search = [];
@pudquick
pudquick / parse_pbzx2.py
Created April 8, 2015 05:27
A pbzx stream decoder for the format found within Yosemite package payloads.
# v2 pbzx stream handler
# My personal writeup on the differences here: https://gist.github.com/pudquick/29fcfe09c326a9b96cf5
#
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here:
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html
#
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne
# https://gist.github.com/bruienne/029494bbcfb358098b41
import struct, sys
<?php
namespace shoghicp\MinecraftSimulator\task;
use pocketmine\Player;
use pocketmine\scheduler\PluginTask;
use shoghicp\MinecraftSimulator\Loader;
class MarqueeTask extends PluginTask{
@shoghicp
shoghicp / commands.md
Last active October 29, 2023 18:16
Some interesting commands to play with the new NBT support for items.

Items with custom name

give sho stick 1 {display:{Name:"§r§6§lNormal stick"}}

Items with enchantments

give sho gold_sword 1 {ench:[{id:9s,lvl:2s}]}
@ericandrewlewis
ericandrewlewis / index.md
Last active November 24, 2023 14:07
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.

@PEMapModder
PEMapModder / dot.php
Last active November 18, 2015 14:44
<?php
/**
* @param number $x the X coordinate of the center of the circle
* @param number $y the Y coordinate to place particles at
* @param number $z the Z coordinate of the center of the circle
* @param number $radius the distance for each dot from the center
* @param number $step the angle per step, in degrees
* @param callable $callback the function to call for each dot, with parameters $x, $y, $z representing the coordinates of the dot
*/
#!/bin/bash
USER="root"
PASSWORD=""
FILES="/Users/tenold/Backups/MySQL/*"
for f in $FILES
do
echo "Processing $f file..."