This file contains hidden or 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); | |
// A PHP library like Pydantic settings where a config object maps automatically to env vars. | |
// The object should be read-only. Super simple in scope. | |
// Attributes: Env\String(), Int, Float, Bool, ArrayList, ArrayMap, Laravel Collection OptionsMap (list of allowed values) DSN, JSONMap, JSONArray, Nullable*. Default parameter. Prefixed, Fallback. Callable(fn () => ...) | |
// Ability to read from $_ENV or getenv(). Need two "Reader" classes. Reader could handle PREFIX_ stuff more naturally. | |
// EnvReader::set(new ServerEnvReader()), EnvReader::get() | |
// new GetEnvReader(), new PrefixedEnvReader(new GetEnvReader()), new FallbackEnvReader(..., ...) | |
// Throw if type mismatches (strict_types). |
This file contains hidden or 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 | |
// Download Unicode database CSV: | |
$ch = curl_init(); | |
curl_setopt_array($ch, $options = [ | |
CURLOPT_URL => 'https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt', | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_TIMEOUT => 15, | |
CURLOPT_FAILONERROR => true, |
This file contains hidden or 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 | |
// A rubbish AI-generated logger output class: | |
namespace App\Console\Output; | |
use Illuminate\Support\Facades\Log; | |
use Psr\Log\LoggerInterface; | |
use Symfony\Component\Console\Formatter\OutputFormatter; | |
use Symfony\Component\Console\Formatter\OutputFormatterInterface; | |
use Symfony\Component\Console\Output\Output; |
This file contains hidden or 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
#!/usr/bin/env bash | |
DEBUG=pw:protocol DEBUG_FILE=logs.txt ./node_modules/.bin/playwright run-server --host [HOST] --port [PORT] --mode launchServer |
This file contains hidden or 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 | |
// In a Terminal tab run: | |
// > php artisan scratch && php artisan queue:work --queue=test | |
// | |
// In a new Terminal tab run: | |
// > kill -[NUM] $(pidof -s php artisan queue:work) | |
// | |
// Results: | |
// -2 (SIGINT) = Job continues looping. |
This file contains hidden or 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
services: | |
minio: | |
image: minio/minio:latest | |
restart: always | |
hostname: minio | |
ports: | |
- "9000:9000" | |
- "9001:9002" | |
environment: | |
MINIO_ROOT_USER: minio |
This file contains hidden or 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
A simple way to dual boot that doesn't involve messing around with boot managers and master boot records: | |
- Install Windows on SSD 1. | |
- Disconnect SSD 1. | |
- Install Linux on SSD 2. | |
- Reconnect SSD 1. | |
- Use BIOS boot device selector menu to switch (e.g. F8). |
This file contains hidden or 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 | |
use Illuminate\Contracts\Container\Container; | |
use Illuminate\Contracts\Container\ContextualAttribute; | |
use Illuminate\Support\Facades\Artisan; | |
#[Attribute(Attribute::TARGET_PARAMETER)] | |
class LazyGhost implements ContextualAttribute | |
{ | |
/** |
This file contains hidden or 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
Channel: https://www.youtube.com/feeds/videos.xml?channel_id=<channel-id> | |
Playlist: https://www.youtube.com/feeds/videos.xml?playlist_id=<playlist-id> | |
User: https://www.youtube.com/feeds/videos.xml?user=<user_id> | |
Link: https://news.ycombinator.com/item?id=32192352 |
This file contains hidden or 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\Providers; | |
use Illuminate\Support\Facades\Artisan; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Testing\Concerns\TestDatabases; | |
use Illuminate\Testing\ParallelTestingServiceProvider as LaravelParallelTestingServiceProvider; | |
// Laravel doesn't support changing the database connection when running tests in parallel, so we have to override the relevant method. |
NewerOlder