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 | |
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; |
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 | |
final class SafeCast | |
{ | |
/** | |
* Converts the given variable to an integer. | |
* | |
* Allowed types are int, float and string. | |
* | |
* - int values are returned as is; |
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
{ | |
"require": { | |
"doctrine/orm": "^2.8", | |
"brick/geo": "^0.4.0" | |
} | |
} |
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 | |
// Configure here the classes to export. Example: | |
$classes = [ | |
'GEOSGeometry', | |
'GEOSWKBReader', | |
'GEOSWKBWriter', | |
'GEOSWKTReader', | |
'GEOSWKTWriter' | |
]; |
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 | |
/** | |
* Tokenizes a PHP script with token_get_all(), and outputs a readable representation. | |
* | |
* Usage: tokenize-php-script.php FILE.php | |
* | |
* Sample output: | |
* | |
* 1 T_OPEN_TAG <?php\n |
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 | |
/** | |
* Two methods to get the dominant color from an image. | |
* Useful to create placeholders while loading an image. | |
* | |
* Method 1 yields more bright colors than method 2. | |
*/ | |
/** |
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
-----BEGIN CERTIFICATE----- | |
MIIDdTCCAl2gAwIBAgIUN09wV0sbUhrzQ9WonV0xOabJqJ8wDQYJKoZIhvcNAQEL | |
BQAwSjELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD19EZXZlbG9wbWVudCBDQTEhMB8G | |
A1UEAwwYRGV2ZWxvcG1lbnQgY2VydGlmaWNhdGVzMB4XDTIwMTAxNDE2MTA0NFoX | |
DTMwMTAxMjE2MTA0NFowSjELMAkGA1UEBhMCVVMxGDAWBgNVBAoMD19EZXZlbG9w | |
bWVudCBDQTEhMB8GA1UEAwwYRGV2ZWxvcG1lbnQgY2VydGlmaWNhdGVzMIIBIjAN | |
BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzpZt/KQzyM+eJW336oeZFb+wqrBQ | |
gcTPttoRIbaVKvxsGUiXcf1RaYrn9KLfNn3J6HGv6s1gO/sPooNch53dq8pkqPtZ | |
VQUn66A/0FIMvkBd0Y/zTb5n4eTFwJcrn1xhYiBEODkkr+4c6YAAzDGg2ngY6gay | |
0womr6C72NDOFQCXVewr+KkXi6DWqIF1cE4hBZ0i97ASMCkWGL/3+cotzmbdBkE1 |
NewerOlder