Skip to content

Instantly share code, notes, and snippets.

View bwaidelich's full-sized avatar
🏠
Working from home

Bastian Waidelich bwaidelich

🏠
Working from home
View GitHub Profile
@bwaidelich
bwaidelich / machine.js
Created March 21, 2021 14:57
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
initial: 'idle',
context: {
userId: null,
projectId: null,
revision: 0
},
type: 'parallel',
states: {
@bwaidelich
bwaidelich / machine.js
Created March 19, 2021 18:47
Generated by XState Viz: https://xstate.js.org/viz
const myMachine = Machine({
id: "machine",
initial: "idle",
context: {
id: null,
revision: 0,
isOwner: false,
isAuthenticated: true
},
states: {
@bwaidelich
bwaidelich / machine.js
Last active March 13, 2021 20:09
Generated by XState Viz: https://xstate.js.org/viz
const myMachine = Machine({
id: "machine",
initial: "idle",
context: {
id: null,
revision: 0,
isOwner: false,
isAuthenticated: false
@bwaidelich
bwaidelich / machine.js
Last active February 17, 2021 13:52
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'doctor',
initial: 'idle',
states: {
idle: {
type: 'parallel',
states: {
aok: {
initial: 'idle',
states: {
@bwaidelich
bwaidelich / GraphQlMiddleware.php
Created January 18, 2021 09:01
Minimal GraphQL example for Flow for interface types
<?php
declare(strict_types=1);
namespace Some\App;
use GraphQL\Error\DebugFlag;
use GraphQL\GraphQL;
use GraphQL\Utils\BuildSchema;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
@bwaidelich
bwaidelich / Green.jpg
Last active January 10, 2021 13:49
Powered*
Green.jpg
@bwaidelich
bwaidelich / SketchSystems.spec
Last active January 10, 2021 11:56
Powered*
Powered*
power failed -> Unpowered
Green*
tick -> Yellow
Yellow
tick -> Red
Red
@bwaidelich
bwaidelich / FusionEmailFinisher.php
Created August 6, 2020 08:22
A Fusion/Eel capable Flow Form Email Finisher
<?php
namespace Your\Package\Form\Finishers;
use Neos\Eel\EelEvaluatorInterface;
use Neos\Eel\Exception as EelException;
use Neos\Eel\Package as EelPackage;
use Neos\Eel\Utility as EelUtility;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\ResourceManagement\PersistentResource;
use Neos\Flow\ResourceManagement\ResourceManager;
@bwaidelich
bwaidelich / Customer.php
Last active July 29, 2020 10:13
Serializable Value Object
<?php
final class Customer implements \JsonSerializable
{
private CustomerId $id;
private FullName $name;
public function __construct(CustomerId $id, FullName $name)
{
$this->id = $id;
@bwaidelich
bwaidelich / SomeIdentifier.php
Last active January 14, 2022 09:34
Example of a "constant" value object that can be compared
<?php
final class SomeIdentifier
{
/**
* @var string
*/
private $value;
/**
* @var self[]