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
import queue | |
import threading | |
import os | |
import time | |
import signal | |
class Worker(threading.Thread): | |
def __init__(self, tasks, results): | |
super().__init__() | |
self.tasks = tasks |
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
#!/usr/bin/env bash | |
DIR="$(cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" | |
cd "$DIR" | |
while getopts "p:f:l" OPTION 2> /dev/null; do | |
case ${OPTION} in | |
p) | |
PHP_BINARY="$OPTARG" | |
;; | |
f) |
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
{ | |
"format_version": "1.12.0", | |
"minecraft:geometry": [ | |
{ | |
"bones": [ | |
{ | |
"name": "body", | |
"parent": "waist", | |
"pivot": [ | |
0, |
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
{ | |
"format_version": "1.14.0", | |
"minecraft:geometry": [ | |
{ | |
"bones": [ | |
{ | |
"locators": { | |
"armor_offset.default_neck": [ | |
0, | |
24, |
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 Centering | |
* | |
* Сhanges the received strings centered relative to each other | |
* | |
* @param string $str1 The first string. | |
* @param string $str2 The second string. | |
* @param string $encoding The encoding to use, defaults to UTF-8. |
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 | |
$message = 'test^т е с т^456%:7?Ũ₦NⓃⓝўї中文''; | |
if (preg_match_all('/[' . | |
'\x{0041}-\x{005A}\x{0061}-\x{007A}' . // all english lang letters | |
'\x{0410}-\x{044F}\x{0451}\x{0401}' . // all russian lang letters (include Ё) | |
'\x{040E}\x{045E}' . // belorussian lang letters (ў) | |
'\x{0404}\x{0454}\x{0406}\x{0456}\x{0407}\x{0457}' . // all ukrainian lang letters (ї etc) | |
'\x{0020}-\x{0040}' . // other support symbols (#@$! etc) (include space) | |
'\x{005B}-\x{005F}' . // ASCII Punctuation |
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 | |
final class StrParser | |
{ | |
public const LETTER_A = 'A|Ⓐ|ⓐ|a|á|À|Â|à|Â|â|Ä|ä|Ã|ã|Å|å|α|Δ|Λ|λ|Ꭿ|∀|₳|Ǻ|ǻ|α|ά|Ǡ|Ắ|ắ|Ằ|ằ|ẳ|Ẵ|ẵ|Ä|ª|ä|Å|À|Á|Â|å|ã|â|à|á|Ã|ᗩ|@|Ⱥ|Ǟ'; | |
public const LETTER_B = 'B|Ⓑ|ⓑ|b|ß|Β|β|ℬ|Ᏸ|β|฿|ß|Ђ|ᗷ|ᗽ|ᗾ|ᗿ|Ɓ|ƀ|ხ|␢|Ᏸ|ᗸ|ᗹ|ᛔ'; | |
public const LETTER_C = 'C|Ⓒ|ⓒ|c|Ç|ç|¢|©|☾|ℭ|ℂ|Ç|¢|ç|Č|ċ|Ċ|ĉ|ς|Ĉ|ć|Ć|č|Ḉ|ḉ|⊂|Ꮸ|₡|¢|Ⴚ'; | |
public const LETTER_D = 'd|Ⓓ|ⓓ|Þ|þ|Ð|ð|∂|ᗫ|Ɗ|Ď|ď|Đ|đ|ð|∂|₫|ȡ|ᚦ|ᚧ'; | |
public const LETTER_E = 'E|Ⓔ|ⓔ|e|ℰ|ℯ|ໂ|६|£|Ē|℮|ē|Ė|ė|Ę|ě|Ě|ę|Έ|ê|ξ|Ê|È|€|É|∑|Ế|Ề|Ể|Ễ|é|è|عЄ|є|έ|ε|Ҿ|ҿ'; | |
public const LETTER_F = 'F|Ⓕ|ⓕ|f|ƒ|ℱ|₣|ƒ|∮|Ḟ|ḟ|ჶ|ᶂ|φ|ᚨ|ᚩ|ᚪ|ᚫ'; |
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 | |
$chunkX = -10; | |
$chunkZ = 10; | |
$minX = $chunkX << 4; | |
$maxX = $minX + 16; | |
$minZ = $chunkZ << 4; | |
$maxZ = $minZ + 16; |
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 | |
public function getRomanNumeral(int $integer): string | |
{ | |
$romanNumeralConversionTable = [ | |
'M' => 1000, | |
'CM' => 900, | |
'D' => 500, | |
'CD' => 400, | |
'C' => 100, |
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; | |