Moved to: https://asgrim.github.io/darklord/items/#from-blista
| <?php | |
| class x { | |
| async static function highlightFileContents($path) { | |
| $source = await Amp\File\get($path); | |
| return highlight_string($source, true); | |
| } | |
| } | |
| $highlighted = Amp\wait(x::highlightFileContents("helpers.php")); |
| <?php | |
| class x { | |
| async public function highlightFileContents($path) : string { | |
| $source = await Amp\File\get($path); | |
| return highlight_string($source, true); | |
| } | |
| } | |
| $highlighted = Amp\wait((new x())->highlightFileContents("helpers.php")); |
Moved to: https://asgrim.github.io/darklord/zones/
This prototype works, but it’s not pretty, and now it’s in production. That legacy application really needs some TLC. Where do we start? When creating long lived applications, it’s imperative to focus on good practices. The solution is to improve the whole development life cycle; from planning, better coding and testing, to automation, peer review and more. In this tutorial, we’ll take a deep dive into each of these areas, looking at how we can make positive, actionable change in our workflow.
This workshop intends to improve your skills in planning, documenting, some aspects of development, testing and delivery of software for both legacy and greenfield projects. The workshop is made up of multiple exercises, allowing dynamic exploration into the various aspects of the software development life cycle. In each practical exercise, we'll brainstorm and investigate solutions, ensuring they are future-proofed, well tested and lead to the ultimate goal of conf
| #!/bin/bash | |
| set -uox pipefail | |
| RUN=true | |
| TIMEOUT=60 | |
| trap 'kill -INT -$PID; RUN=false' INT | |
| file="/tmp/ips" | |
| # varnishncsa > $file |
| <?php | |
| declare(strict_types=1); | |
| use Roave\BetterReflection\BetterReflection; | |
| use Roave\BetterReflection\Reflector\ClassReflector; | |
| use Roave\BetterReflection\Reflector\FunctionReflector; | |
| use Roave\BetterReflection\SourceLocator\Type\SingleFileSourceLocator; | |
| $fileName = 'my-file-with-stuff.php'; |
| <?php | |
| final class BookHandler | |
| { | |
| public function __construct(AggregateRepository $bookLibrary) {} | |
| public function handleCheckInBook(CheckInBook $command) {} | |
| public function handleCheckOutBook(CheckOutBook $command) {} | |
| } |
| <?php | |
| declare(strict_types=1); | |
| namespace StaticAnalysisPlugin; | |
| use PhpParser\Node\Expr; | |
| use PhpParser\Node\Expr\MethodCall; | |
| use PhpParser\Node\Expr\StaticCall; | |
| use Psalm\Codebase; |
| $ composer create-project laravel/laravel:6.* test-app --prefer-dist | |
| Creating a "laravel/laravel:6.*" project at "./test-app" | |
| Installing laravel/laravel (v6.20.1) | |
| - Installing laravel/laravel (v6.20.1): Extracting archive | |
| Created project in /tmp/laravel-create-test/test-app | |
| > @php -r "file_exists('.env') || copy('.env.example', '.env');" | |
| Loading composer repositories with package information | |
| Updating dependencies | |
| Lock file operations: 93 installs, 0 updates, 0 removals | |
| - Locking doctrine/inflector (2.0.4) |