Skip to content

Instantly share code, notes, and snippets.

View KennFatt's full-sized avatar
🌠
Stargazing

Kennan Fattahillah KennFatt

🌠
Stargazing
View GitHub Profile
@KennFatt
KennFatt / run.php
Created December 29, 2017 11:31 — forked from dktapps/run.php
A basic UDP proxy used to bypass client-side Xbox Live authentication in MCPE 1.2.
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
@KennFatt
KennFatt / enable_strict_types.php
Created December 29, 2017 11:33 — forked from dktapps/enable_strict_types.php
Hacked-together script to enable strict types in PHP files en masse. Primarily intended for PocketMine-MP.
<?php
declare(strict_types=1);
$startTime = microtime(true);
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR));
foreach($iterator as $file){
if($file->getExtension() === "php"){
$path = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename();
@KennFatt
KennFatt / inarray_flipisset_arraysearch.php
Created January 17, 2018 17:53 — forked from ksimka/inarray_flipisset_arraysearch.php
in_array vs array_flip+isset vs array_search
<?php
$a = [];
//$s = 123456;
$s = 's6tbdfgj222dJGk';
$rs = str_repeat("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 10);
$numGen = function() {
return rand(1, 9999999);
};
@KennFatt
KennFatt / git-selective-merge.md
Created January 26, 2018 13:25 — forked from katylava/git-selective-merge.md
git selective merge

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp
@KennFatt
KennFatt / SkinListener.php
Created March 19, 2018 08:34 — forked from xISRAPILx/SkinListener.php
Получение головы игрока и перевод в PNG изображение.
<?php
namespace xISRAPILx\listener;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerJoinEvent;
use xISRAPILx\SkinMain;
class SkinListener implements Listener{
@KennFatt
KennFatt / UdpServer.kt
Created March 23, 2018 17:59 — forked from codingtim/UdpServer.kt
Simple udp server with netty 4.1 and kotlin
import io.netty.bootstrap.Bootstrap
import io.netty.channel.ChannelHandlerContext
import io.netty.channel.SimpleChannelInboundHandler
import io.netty.channel.nio.NioEventLoopGroup
import io.netty.channel.socket.nio.NioDatagramChannel
import io.netty.util.CharsetUtil
import io.netty.util.concurrent.DefaultThreadFactory
import kotlinx.coroutines.experimental.async
import kotlinx.coroutines.experimental.newFixedThreadPoolContext
@KennFatt
KennFatt / SplClassLoader.php
Created May 5, 2018 15:23 — forked from jwage/SplClassLoader.php
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@KennFatt
KennFatt / date.cpp
Created September 2, 2018 06:05 — forked from dibakarsutradhar/date.cpp
A date program using struct
#include <iostream>
using namespace std;
struct DateStruct {
int year;
int month;
int day;
};