This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function paint($minX, $maxX, $minZ, $maxZ) | |
{ | |
$fromX = $minX >> 4; | |
$toX = $maxX >> 4; | |
$fromZ = $minZ >> 4; | |
$toZ = $maxZ >> 4; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
Armor: [{ | |
Count: 0b, | |
Damage: 0 s, | |
Name: "", | |
WasPickedUp: 0b | |
}, { | |
Count: 0b, | |
Damage: 0 s, | |
Name: "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: MakStashkevich | |
* Date: 30.08.2018 | |
* Time: 16:31 | |
*/ | |
class Query | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Multibyte String Pad | |
* | |
* Functionally, the equivalent of the standard str_pad function, but is capable of successfully padding multibyte strings. | |
* | |
* @param string $input The string to be padded. | |
* @param int $pad_length The length of the resultant padded string. | |
* @param string $pad_string The string to use as padding. Defaults to space. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Because JSON directly supports the \uxxxx syntax the first thing that comes into my mind is: | |
$unicodeChar = '\u1000'; | |
echo json_decode('"'.$unicodeChar.'"'); | |
// Another option would be to use mb_convert_encoding() | |
echo mb_convert_encoding('က', 'UTF-8', 'HTML-ENTITIES'); | |
// or make use of the direct mapping between UTF-16BE (big endian) and the Unicode codepoint: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Strips leading zeros | |
// And returns str in UPPERCASE letters with a U+ prefix | |
function format($str) { | |
$copy = false; | |
$len = strlen($str); | |
$res = ''; | |
for ($i = 0; $i < $len; ++$i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class LevelUtils | |
{ | |
/** | |
* @param Vector3 $pos1 | |
* @param Vector3 $pos2 | |
*/ | |
static function printRegions(array $pos1, array $pos2) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface BlockIds | |
{ | |
const AIR = 0; | |
const STONE = 1; | |
const GRASS = 2; | |
const DIRT = 3; | |
const COBBLESTONE = 4, COBBLE = 4; | |
const PLANK = 5, PLANKS = 5, WOODEN_PLANKS = 5, WOODEN_PLANK = 5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir -Include *.js -Recurse | Measure-Object -Line -Character -Word -IgnoreWhiteSpace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(для Debian пути и команды могут отличаться) | |
sudo apt-get --purge remove mariadb* | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
если возникают ошибки при удалении - | |
заходим в папку /var/lib/dpkg/info | |
и удаляем там всё что начинается на mariadb и на mysql | |
повторяем предыдущие три команды |