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
Replace path to UT99 with your install path, then run the .reg file. | |
https://steamcommunity.com/sharedfiles/filedetails/?id=272924930 | |
https://ut99.org/viewtopic.php?t=6020 |
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 | |
// Before Laravel 10.15.0 | |
function prepareQuery(QueryExecuted $query): string | |
{ | |
return count($query->bindings) > 0 | |
? vsprintf(str_replace(['%', '?'], ['%%', '%s'], $query->sql), array_map(fn ($value) => (is_numeric($value) ? $value : "'" . $value . "'"), $query->bindings)) | |
: $query->sql; | |
} | |
prepareQuery($query); |
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 | |
namespace App\Console\Commands; | |
class MyCommand extends Command | |
{ | |
protected $signature = 'app:my-command'; | |
public function handle(): int | |
{ |
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 | |
enum Foo: string | |
{ | |
case A = 'A'; | |
case B = 'B'; | |
case C = 'C'; | |
public function next(): self | |
{ |
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 | |
// @see: https://www.noulakaz.net/2007/03/18/a-regular-expression-to-check-for-prime-numbers/ | |
// @see: https://web.archive.org/web/20220522073029/http://montreal.pm.org/tech/neil_kandalgaonkar.shtml#this_vs_mine | |
// @see: https://web.archive.org/web/20220513113609/http://neilk.net/blog/2000/06/01/abigails-regex-to-test-for-prime-numbers/ | |
// @see: https://web.archive.org/web/20080111215127/http://www.mit.edu:8008/bloom-picayune.mit.edu/perl/10138 | |
// @see: https://news.ycombinator.com/item?id=36413260 | |
function regexp_prime(int $num): bool | |
{ | |
return preg_match('/^1?$|^(11+?)\1+$/x', str_repeat('1', $num), $matches) !== 1; |
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 SortAssoc | |
{ | |
public function __construct(private readonly array $array, private readonly array $columns = []) | |
{ | |
} | |
public function __invoke(): array | |
{ | |
$array = $this->array; |
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
with recursive 15min_windows as ( | |
select | |
curdate() + interval 8 hour as start, | |
curdate() + interval 8 hour + interval 15 minute as end | |
union | |
select | |
end, | |
end + interval 15 minute | |
from 15min_windows | |
where end < curdate() + interval 16 hour |
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
# Put this inside /bin/test.sh to install Laravel's dependencies before running testsuite in Docker. | |
docker run \ | |
-it \ | |
--rm \ | |
-w /data \ | |
-v ${PWD}:/data:delegated \ | |
--entrypoint /bin/sh \ | |
registry.gitlab.com/grahamcampbell/php:8.1-base -c 'curl -o /tmp/composer-setup.php https://getcomposer.org/installer && php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer && composer install' |
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
version: '3.4' | |
services: | |
miniflux: | |
image: miniflux/miniflux:latest | |
ports: | |
- "80:8080" | |
depends_on: | |
- db | |
environment: | |
- DATABASE_URL=postgres://miniflux:secret@db/miniflux?sslmode=disable |
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 | |
// @see: https://github.com/sebastianbergmann/phpunit/issues/4026 | |
// Use `$this->with(...$this->consecutiveParams($args1, $args2))` instead of `$this->withConsecutive($args1, $args2)`. | |
use PHPUnit\Framework\TestCase; | |
class FooTest extends TestCase | |
{ | |
use ConsecutiveParams; |