This file contains 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
From 664f364c5c08a4bcb51d8ebdda2f72b9e8f8d491 Mon Sep 17 00:00:00 2001 | |
From: Benjamin Morel <benjamin.morel@gmail.com> | |
Date: Sun, 17 Sep 2023 14:50:28 +0200 | |
Subject: [PATCH] Patch | |
--- | |
scripts/mysql/mysql_load_db.sh | 5 ++--- | |
1 file changed, 2 insertions(+), 3 deletions(-) | |
diff --git a/scripts/mysql/mysql_load_db.sh b/scripts/mysql/mysql_load_db.sh |
This file contains 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 | |
declare(strict_types=1); | |
error_reporting(E_ALL); | |
set_error_handler(function ($severity, $message, $file, $line) { | |
if ((error_reporting() & $severity) === 0) { | |
return false; | |
} |
This file contains 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 | |
/** | |
* Quick script to display InnoDB inserts/updates/deletes/reads per second in real time. | |
* | |
* Sample output: | |
* | |
* Inserts 40,368.63 /s | |
* Updates 19.98 /s | |
* Deletes 9.99 /s |
This file contains 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 | |
/** | |
* Generates a php.ini file from runtime ini directives, excluding extensions incompatible with JIT. | |
* I did not find a way to disable an extension from the command line, so this script is a workaround. | |
* | |
* Use it this way: | |
* | |
* php generate-jit-php-ini.php > php.ini | |
* php -n -c php.ini |
This file contains 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 | |
/** | |
* This script streams a file that is being written to by another process. | |
* It will continue fread()ing past EOF until explicitly stopped with CTRL+C. | |
* | |
* The script will exit with a status code of 0 if and only if the stream is stopped *after* EOF has been reached, | |
* i.e. if actual EOF *MAY* have been reached. | |
* | |
* The output of the streamed file is sent to STDOUT, and the output of the script is sent to STDERR, |
This file contains 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 | |
/** | |
* This script downloads the list of releases of a project via the GitHub API, | |
* and generates a changelog out of it. | |
* | |
* Example, to generate a changelog for brick/math: | |
* | |
* php changelog-from-github-api.php brick/math > CHANGELOG.md | |
*/ |
This file contains 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 | |
/** | |
* Examples: | |
* | |
* errorLevelToConstants(E_WARNING) => ['E_WARNING', 'E_ALL'] | |
* errorLevelToConstants(3) => ['E_ERROR', 'E_WARNING', 'E_ALL'] | |
* | |
* @return string[] | |
*/ |
This file contains 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
/** | |
* Fix for vw, vh, vmin, vmax on iOS 7. | |
* http://caniuse.com/#feat=viewport-units | |
* | |
* This fix works by replacing viewport units with px values on known screen sizes. | |
* | |
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix. | |
* Target devices running iOS 8+ will incidentally execute the media query, | |
* but this will still produce the expected result; so this is not a problem. |
This file contains 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 | |
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
socket_bind($sock, '0.0.0.0', 10000); | |
for (;;) { | |
socket_recvfrom($sock, $message, 1024, 0, $ip, $port); | |
$reply = str_rot13($message); | |
socket_sendto($sock, $reply, strlen($reply), 0, $ip, $port); | |
} |
This file contains 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 | |
require 'vendor/autoload.php'; | |
use Symfony\Component\PropertyInfo\Extractor\ConstructorExtractor; | |
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor; | |
use Symfony\Component\PropertyInfo\PropertyInfoExtractor; | |
use Symfony\Component\Serializer\Encoder\JsonEncoder; | |
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer; | |
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; |
NewerOlder