Skip to content

Instantly share code, notes, and snippets.

Avatar

Derick Rethans derickr

View GitHub Profile
View workers.php
<?php
class Calculator
{
private int $lastResult;
static private function fib(int $n) : int
{
if ($n <= 1) {
return 1;
}
@derickr
derickr / save-code-coverage.php
Created Nov 21, 2022
save-code-coverage.php
View save-code-coverage.php
<?php
require 'vendor/autoload.php';
use SebastianBergmann\CodeCoverage\Filter;
use SebastianBergmann\CodeCoverage\Driver\Selector;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Report\PHP as PhpReport;
$filter = new Filter;
$filter->includeDirectory( __DIR__ . '/html' );
View MANIFEST-7.4.33
php-7.4.33.tar.gz
SHA256 hash: 5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAmNftBIACgkQkQ3rRvU+
oxLSuRAAxLCfYYOQ25Q/svXyBjqylG/2zpd95PBTp0zxlVisqR6+QsYnHo5jMkqm
JIjI+aqA9XCrz7ftUIOB98JvvaDKSMkLOxYPN18yjdzf1XRDZdYzU67FwmO5XmVD
kW7u0oXE2cXl1KaNVNNWEdvD9n0TuHJIkMYZ8XiFsNVQ0YiIy2kNX8OeKkvxpHq7
VgA5wi5Y7HiS/L2JwYPgbrMn9XgzDPvg8zh9QM7fYXCGWEGSsLyIe7Ff60P+hhHY
View MANIFEST-7.4.32
php-7.4.32.tar.gz
SHA256 hash: 197e3372afd69694eb6b230838305eb9e1cbe5db272e0fa3bbe0d38e329a95bc
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAmM0EBwACgkQkQ3rRvU+
oxLbRg/+MjQ9bwaWvy+j4POIelnek+0v7s9brStUwWXPoj87Oo71K8krrXBRaqgZ
J1p6pWDzMDrDqkVRkgJhkqDIWMJpVrm0vdaN2UnBtYBc94keXyT1cQMNsFTnHsDt
qSpTl3id3KlEiME2qmyCIRF7jLLuv7RjQGO9UfPAQwDMojmakuNfauf+r2kycfhb
Ox2bD8gOOQphkiha9560DUMnWco9scD9WCZDEB412rNlqtvt1eK2meRpT3+ITnWL
View MANIFEST-7.4.31
php-7.4.31.tar.gz
SHA256 hash: ad435324863b8d0e2727c22cc6f81bfd0084f9b49d54b153a9f1c48d297c9de1
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAmMzAR0ACgkQkQ3rRvU+
oxKEMxAA1wv0Vl8VchRAtCR2Z+1LJV1mVyXsW77ExGEuNFaFiqwlUh6tVWb3WnZM
w61FpQbE4o0mC4CWwlrjAaDQXcTVI0+EoA/62949JnnCWuYravSUjheTE6W2w2Px
CUCzObFIFjLcW3lLreLmb/2HIMndNAaKeudRcFZh48M6+Dj4Xipoc1eiC7rJkcVO
sVA57Jz6ZLKsHGpoHtsVqteb4gRO1Zfcn55sd20D2+WolK90vrRkyz32WQMAqUJq
View stv.php
<?php
/* Find files */
$files = glob( $argv[1] );
sort( $files );
echo "Reading from: \n- ", implode( "\n- ", $files ), "\n\n";
/* Read Amount of Seats from Command Line */
array_shift( $argv );
array_shift( $argv );
$seats = (int) $argv[0];
View MANIFEST-7.4.30
php-7.4.30.tar.gz
SHA256 hash: e37ea37e0f79109351ac615da85eb7c2c336101fc5bc802ee79a124a4310dc10
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAmKfDt4ACgkQkQ3rRvU+
oxKKdA/6Aja2k6Ck92I3N/otL+BTgtJVOoH+S3VWeTGqz7WH6EkfI6Se/hhsmc1z
ncTlKcfiKVx6CriGGTWc7+aOHx/rQoqUk9fNDCpKwqj2MtTDH+r5EJLc1gmd8LH0
oM3YjcTeh7XnLStZTD4RVPZ88cr6aUoYKfg/SIJaMGjzWsBEM4mtJ5bWAQJRZHvn
u/R3b9XahNiA8b02MJaRKQa7qks8nkDX9f81SABYvajf7He3KhMhsbip90V3a+Ry
View PHP 8.2 RM election
```
Reading from:
- php_8.2_rm_1st_preference.doodle
- php_8.2_rm_2nd_preference.doodle
- php_8.2_rm_3rd_preference.doodle
- php_8.2_rm_4th_preference.doodle
- php_8.2_rm_5th_preference.doodle
- php_8.2_rm_6th_preference.doodle
- php_8.2_rm_7th_preference.doodle
@derickr
derickr / README.md
Created Apr 26, 2022
Example on how to format date/time's correctly with locales using CLDR
View README.md

Require the ICanBoogie/CLDR package:

composer require ICanBoogie/CLDR

Run on the command line, with:

php format.php [tzid] [locale]
View MANIFEST-7.4.29
php-7.4.29.tar.gz
SHA256 hash: f73f89873bb9447cb99eb4863cf0a0deab4481cb8acf7552c0e70647e6885854
PGP signature:
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEWlKIB4H3VWCL+BX8kQ3rRvU+oxIFAmJVWxAACgkQkQ3rRvU+
oxIpsQ/6A3kcmwhZMjaO8aNZ1XxhO1cHojteMLtwRwEIHeE22h0vMmGFYhYokxCc
7bo4G0JIha22f4qigtRzt+PqDkD6rySaUshSf3Hshv6DcOKlh6cFzJTFhAQv7i9r
MtYSEbHiaJHq0q9uNFvJnsTjIgP085lFxddOVYP7q2yQqV4wjLUnr9IcNlAhzM3k
vs6jEBeoYYzRYZhtpCo52mS0HIIItJ/IpHzRP7fjf0QX2OODTIbBgT8mU/t9xTFm