Skip to content

Instantly share code, notes, and snippets.

View MakStashkevich's full-sized avatar
🍀
believe on the best

Maksim Stashkevich MakStashkevich

🍀
believe on the best
View GitHub Profile
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@Encritary
Encritary / Trading.php
Created December 27, 2017 05:30
Trading example for Prismarine 1.2; to use this on pmmp you have to rewrite this a bit
<?php
namespace Encritary;
use pocketmine\entity\Entity;
use pocketmine\entity\Villager;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerInteractEvent;
use pocketmine\event\player\PlayerQuitEvent;
use pocketmine\event\server\DataPacketReceiveEvent;
@Encritary
Encritary / Trading.php
Created December 27, 2017 05:09
Trading example for GenisysPro or Prismarine server softwares
<?php
namespace Encritary;
use pocketmine\entity\Entity;
use pocketmine\entity\Villager;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerInteractEvent;
use pocketmine\event\player\PlayerQuitEvent;
use pocketmine\event\server\DataPacketReceiveEvent;
2017-12-26 10:30:10,034 DEBUG MiNET.Client.MiNetClient - PlayerEquipment: Entity ID: 19, Selected Slot: 9, Slot: 0, Item ID: 0
2017-12-26 10:30:10,034 DEBUG MiNET.Client.MiNetClient - > Receive: 13 (0x0d): McpeAddEntity
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - McpeAddEntity Entity ID: -4294967290
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - McpeAddEntity Runtime Entity ID: 4
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Entity Type: 2118423 - 0x205317
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Entity Family: 83 - 0x53
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Entity Type ID: 23 - 0x17 Horse
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - X: 781.3013
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Y: 4
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Z: 11.02353
<?php
class Skin{
public static function getTextureFromFile(string $filename) : string{
$im = imagecreatefrompng($filename);
list($width, $height) = getimagesize($filename);
$bytes = "";
for($y = 0; $y < $height; $y++){
for($x = 0; $x < $width; $x++){
$code = imagecolorat($im, $x, $y);
$bytes .= chr(($code >> 16) & 0xff) . chr(($code >> 8) & 0xff) . chr(($code >> 16) & 0xff) . ($code >> 24) & 0xff;
<?php
declare(strict_types=1);
namespace test;
use pocketmine\entity\Skin;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerChatEvent;
@Frago9876543210
Frago9876543210 / info.php
Last active July 11, 2018 11:17
Get server info
<?php
/**
* Script for get info from target server
* @link https://github.com/Frago9876543210
* @author Frago9876543210
*/
declare(strict_types=1);
@Frago9876543210
Frago9876543210 / Gui.cs
Created September 7, 2017 12:59
inv menu
using MiNET.Items;
using MiNET.Net;
using MiNET.Plugins;
using MiNET.Plugins.Attributes;
using MiNET.Utils;
using TestPlugin.Player;
namespace GuiPlugin
{
[Plugin]
@dktapps
dktapps / run.php
Last active February 15, 2023 04:52
A basic UDP proxy used to bypass client-side Xbox Live authentication in MCPE 1.2.
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
@Kamori
Kamori / pony_orm_test.py
Created August 19, 2017 02:45
A ponyorm recursive to_dict example
{1: {'answers': [{'answer': 'here is the answer',
'bestof_question': [],
'created': datetime.datetime(2017, 8, 19, 2, 41, 58),
'id': 1,
'updated': datetime.datetime(2017, 8, 19, 2, 41, 58)}],
'bestanswer': None,
'created': datetime.datetime(2017, 8, 19, 2, 41, 58),
'id': 1,
'statusid': {'Name': 'Example', 'id': 1},
'tags': [],