Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Bastian Waidelich bwaidelich

🏠
Working from home
View GitHub Profile
@bwaidelich
bwaidelich / Example.fusion
Created Jun 21, 2022
Neos CMS: Fusion based Zip Archive (example structure)
View Example.fusion
<Some.Package:ZipArchiveLink zip.files={['resource://Neos.Neos/Public/Images/Login/Logo.svg', 'resource://Neos.Neos/Public/Images/Login/Wallpaper.jpg']} filename="archive.zip">
Download
</Some.Package:ZipArchiveLink>
@bwaidelich
bwaidelich / Configuration_Policy.yaml
Created Nov 25, 2021
Example of a Flow policy that respects method parameters
View Configuration_Policy.yaml
# Concrete assignments from roles to privileges can happen in your global /Configuration/Policy.yaml file
roles:
'Some.Distribution:Administrator':
privileges:
- privilegeTarget: 'Some.Package:AccessAnyProduct'
permission: GRANT
'Some.Distribution:User':
@bwaidelich
bwaidelich / Tests_Behavior_Bootstrap_FeatureContext.php
Last active Apr 22, 2022
GraphQL based Behat testing in Flow
View Tests_Behavior_Bootstrap_FeatureContext.php
<?php
declare(strict_types=1);
use Behat\Behat\Context\Context;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManagerInterface;
use Firebase\JWT\JWT;
View machine.js
const nestedStates = {
initial: 'a1',
states: {
a1: {
on: {
FOO: "a2"
}
},
a2: {
type: "final"
View machine.js
const machine = Machine(
{
id: "buyBook",
initial: "outside",
context: {
loggedIn: false,
subscription: null,
bookId: null,
initialLocation: null,
alreadySubscribedChosen: false
@bwaidelich
bwaidelich / EelRpcMiddleware.php
Created Apr 9, 2021
Neos Eel evaluator as XML-RPC service (just a crazy demo, don't use this in production!)
View EelRpcMiddleware.php
<?php
declare(strict_types=1);
namespace Some\Package;
use GuzzleHttp\Psr7\Response;
use Neos\Eel\Context;
use Neos\Eel\EelEvaluatorInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
View machine.js
const todoMachine = Machine({
id: "todo",
initial: "reading",
context: {
completed: false
},
states: {
reading: {
on: {
SET_COMPLETED: {
View machine.js
const playheadMachine = Machine({
id: 'playhead',
initial: 'idle',
context: {
fps: 2,
events: [],
lastEmittedEvent: null,
emitted: [],
playhead: 0
},
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
const machine = Machine({
initial: 'idle',
context: {
userId: null,
projectId: null,
revision: 0
},
type: 'parallel',
states: {