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 | |
/** | |
* Sample output: | |
* | |
* $ time php queens.php | |
* [ ][ ][ ][ ][ ][X][ ][ ] | |
* [ ][ ][X][ ][ ][ ][ ][ ] | |
* [ ][ ][ ][ ][ ][ ][X][ ] | |
* [ ][X][ ][ ][ ][ ][ ][ ] |
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 | |
$height = 20; | |
$width = 40; | |
$live_seeds = 20; | |
$delay = 1000000; | |
$empty_grid = fn(): array => array_fill(0, $height, array_fill(0, $width, false)); | |
$random_percent = fn(): float => rand(0, 100) / 100; |
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 version replaces the redundant code with a recursive call, but emits these errors: | |
// | |
// ERROR: InvalidReturnType - src/Filter/FilterTransformer.php:111:16 - The declared return type 'Kiosk\Filter\PriceRange|array<array-key, Kiosk\Filter\PriceRange|float>|float' for Kiosk\Filter\FilterTransformer::getPrice is incorrect, got 'Kiosk\Filter\PriceRange|array<int|string(max)|string(min), Kiosk\Filter\PriceRange|array<array-key, Kiosk\Filter\PriceRange|float>|float>|float' (see https://psalm.dev/011) | |
// * @return float|float[]|PriceRange|PriceRange[] | |
// | |
// ERROR: InvalidReturnStatement - src/Filter/FilterTransformer.php:130:16 - The inferred type 'array<int|string(max)|string(min), Kiosk\Filter\PriceRange|array<array-key, Kiosk\Filter\PriceRange|float>|float>' does not match the declared return type 'Kiosk\Filter\PriceRange|array<array-key, Kiosk\Filter\PriceRange|float>|float' for Kiosk\Filter\FilterTransformer::getPrice (see https://psalm.dev/128) | |
// return array_map( | |
// [$t |
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 | |
$contents = file_get_contents(__DIR__ . '/README.md'); | |
$start = 0; | |
while (true) { | |
$start = strpos($contents, '```php', $start); | |
if ($start === false) { | |
break; | |
} |
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 Fatal error: Uncaught ValueError: No stream arrays were passed in vendor/react/event-loop/src/StreamSelectLoop.php:290 | |
Stack trace: | |
#0 vendor/react/event-loop/src/StreamSelectLoop.php(290): stream_select() | |
#1 vendor/react/event-loop/src/StreamSelectLoop.php(231): React\EventLoop\StreamSelectLoop->streamSelect() | |
#2 vendor/react/event-loop/src/StreamSelectLoop.php(212): React\EventLoop\StreamSelectLoop->waitForStreamActivity() | |
#3 vendor/react/event-loop/src/Loop.php(55): React\EventLoop\StreamSelectLoop->run() | |
#4 [internal function]: React\EventLoop\Loop::React\EventLoop\{closure}() | |
#5 {main} | |
thrown in vendor/react/event-loop/src/StreamSelectLoop.php on line 290 |
We made another trip to our old rental property in New Orleans this past weekend. It has had power restored. Most of the standing water was gone. We filled our car with what salvageable possessions we could and brought them back to Lafayete. We've secured a new rental property there and will be moving in over the next week or so. We're planning to make another trip there next weekend to box up the remaining possessions that can be salvaged and transport them to Lafayette in a U-Haul. We're exhausted and still have a lot of things left to do, but we're making progress.
On the morning of Saturday August 28, 2021, we evacuated from our rental home of three and a half years in New Orleans due to Hurricane Ida.
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
const getVideoList = () => document.getElementById("contents"); | |
const getVideoCount = () => { | |
return Number( | |
document | |
.getElementById("stats") | |
.getElementsByClassName("yt-formatted-string")[0] | |
.textContent | |
); | |
} |
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
# https://rustwasm.github.io/docs/book/game-of-life/setup.html | |
FROM rust:alpine3.14 | |
# https://users.rust-lang.org/t/sigsegv-with-program-linked-against-openssl-in-an-alpine-container/52172 | |
ENV RUSTFLAGS="-C target-feature=-crt-static" | |
RUN apk update | |
RUN apk add build-base openssl-dev perl npm git | |
RUN cargo install wasm-pack cargo-generate |