by Tim Speckhals
The Purpose of the 1-Route Protocol is to allow unreachable locations to be reached anyways using a proxy server.
<?php | |
// Your configuration starts here. | |
// Testing. 'true' = Don't actually edit files and only output the name changes. | |
$testing = false; | |
// Folders. 'true' = Rename folders and files. | |
$folders = true; | |
// Recursive. 'true' = Also rename files in sub-directories. |
<?//noshort | |
/* This is a little script built for php on linux to short your PHP Scripts, | |
* it is not, it will never and it is not trying to be perfect, | |
* but it might still help you with your code golfes! | |
*******************************************************/ | |
if(empty($argv[1])) | |
{ | |
echo "Syntax: php shorten.php <file>\n"; |
<?php | |
date_default_timezone_set("Etc/Utc"); | |
$offset = -24; | |
$output = fopen("output.srt", "w"); | |
foreach(file("input.srt") as $line) | |
{ | |
$line = trim($line); |
<?php | |
if(!isset($argv[1])) | |
{ | |
die("Syntax: php fac.php <num>\n"); | |
} | |
$start_time = microtime(true); | |
$fac = $one = gmp_init("1"); | |
$i = gmp_init("1"); | |
$limit = gmp_init($argv[1]); | |
do |
<?php | |
if(empty($argv[1])) | |
{ | |
die("Syntax: php {$argv[0]} <file>"); | |
} | |
$json = json_decode(file_get_contents($argv[1]), true); | |
if($json == NULL) | |
{ | |
die("ERROR: Invalid JSON."); | |
} |
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /F /V PATH /T REG_SZ /D "YOUR_PATH_FOLDER;%PATH%" | |
:: Setting a temporary dummy variable so setx will broadcast WM_SETTINGCHANGE so the PATH change is reflected without needing a restart. | |
SETX /m DUMMY "" | |
REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /F /V DUMMY |
<?php | |
namespace Phpcraft; | |
require "vendor/autoload.php"; | |
$bits_per_block = 5; | |
$bits = ""; | |
foreach([1, 2, 2, 3, 4, 4, 5, 6, 6, 4, 8, 0, 7, 4, 3, 13, 15, 16, 9, 14, 10, 12, 0, 2, 11, 4] as $value) | |
{ | |
$bits .= strrev(str_pad(decbin($value), $bits_per_block, "0", STR_PAD_LEFT)); | |
} |
{ | |
shortTest: 32767s, | |
longTest: 9223372036854775807L, | |
byteTest: 127b, | |
"byteArrayTest (the first 1000 values of (n*n*255+n*7)%100, starting with n=0 (0, 62, 34, 16, 8, ...))": [B; 0B, 62B, 34B, 16B, 8B, 10B, 22B, 44B, 76B, 18B, 70B, 32B, 4B, 86B, 78B, 80B, 92B, 14B, 46B, 88B, 40B, 2B, 74B, 56B, 48B, 50B, 62B, 84B, 16B, 58B, 10B, 72B, 44B, 26B, 18B, 20B, 32B, 54B, 86B, 28B, 80B, 42B, 14B, 96B, 88B, 90B, 2B, 24B, 56B, 98B, 50B, 12B, 84B, 66B, 58B, 60B, 72B, 94B, 26B, 68B, 20B, 82B, 54B, 36B, 28B, 30B, 42B, 64B, 96B, 38B, 90B, 52B, 24B, 6B, 98B, 0B, 12B, 34B, 66B, 8B, 60B, 22B, 94B, 76B, 68B, 70B, 82B, 4B, 36B, 78B, 30B, 92B, 64B, 46B, 38B, 40B, 52B, 74B, 6B, 48B, 0B, 62B, 34B, 16B, 8B, 10B, 22B, 44B, 76B, 18B, 70B, 32B, 4B, 86B, 78B, 80B, 92B, 14B, 46B, 88B, 40B, 2B, 74B, 56B, 48B, 50B, 62B, 84B, 16B, 58B, 10B, 72B, 44B, 26B, 18B, 20B, 32B, 54B, 86B, 28B, 80B, 42B, 14B, 96B, 88B, 90B, 2B, 24B, 56B, 98B, 50B, 12B, 84B, 66B, 58B, 60B, 72B, 94B, 26B, 68B, 20B, 82B, 54B, 36B, 28B, 30B, 42B, 64B, 96B, |
<?php | |
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("Failed to create socket.\n"); | |
socket_set_option($socket, IPPROTO_IP, MCAST_JOIN_GROUP, [ | |
"group" => "224.0.2.60", | |
"interface" => 0 | |
]); | |
socket_bind($socket, "0.0.0.0", 4445) or die("Failed to bind.\n"); | |
$msg_regex = '/^\[MOTD\]([^\[\]]+)\[\/MOTD\]\[AD\]([0-9]{4,5})\[\/AD\]$/'; | |
while(true) | |
{ |