Skip to content

Instantly share code, notes, and snippets.

View tPl0ch's full-sized avatar
💭
I may be slow to respond.

Thomas Ploch tPl0ch

💭
I may be slow to respond.
View GitHub Profile
@tPl0ch
tPl0ch / Main.sc
Last active February 15, 2022 18:16
Message-Driven Finite-State-Transducer Domain-Driven-Design Aggregate
import cats.instances.either._
import Transducer.run
import UserRegistration._
object Main extends App {
private val commands = List(GDPRDeletion, StartRegistration, StartRegistration, ConfirmAccount, GDPRDeletion)
run(userRegistration)(commands).foreach(println)
// OUTPUT

Keybase proof

I hereby claim:

  • I am tpl0ch on github.
  • I am tploch (https://keybase.io/tploch) on keybase.
  • I have a public key ASBQgpVVod2LlBzoMtmmQGqtG25rTc-DC6sBxVQdmDBlOAo

To claim this, I am signing this object:

@tPl0ch
tPl0ch / MoveFileSessionsToMemcachedCommand.php
Created December 5, 2013 01:46
Symfony2 ContainerAwareCommand to transfer file sessions to a memcached interface.
<?php
namespace Application\Bundle\DefaultBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
@tPl0ch
tPl0ch / gist:7596790
Created November 22, 2013 08:43
composer error 1ee30ea592c61825367ddad3ea5111da1c44fcd2 revision
[ErrorException]
Argument 4 passed to Composer\Repository\VcsRepository::__construct() must be of the type array, object given, called in phar:///usr/local/bin/composer.phar/src/Composer/Repository/RepositoryManager.php on line 104 and defined
@tPl0ch
tPl0ch / CommandContext.php
Last active August 18, 2023 11:18
A CommandContext for Behat tests of Symfony Console Commands
<?php
namespace MFB\Behat\Subcontext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\MinkExtension\Context\RawMinkContext;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\EventDispatcher\EventDispatcher;
/**
@tPl0ch
tPl0ch / ValidatableTypeTest.php
Created March 29, 2013 12:50
Set up a Symfony2 FomType unit test with the ```ValidatorExtension``` loaded using the ```TypeTestCase``` class
<?php
/**
* ValidatableTypeTest.php
*
* @filesource
*/
namespace Acme\DemoBundle\Test\Base;
use Symfony\Component\Form\Extension\Core\CoreExtension;
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
# Ubuntu: /etc/apt/preferences.d/php | Debian: /etc/apt/preferences
Package: php5 Pin: version 5.2.17* Pin-Priority: 991
Required packages on host:
cifs-utils
# /etc/samba/smb.conf
...
[www]
comment = www
path = /var/www
public = yes
@tPl0ch
tPl0ch / ShopCompilerPass.php
Created January 18, 2013 12:19
Using DefinitionDecorator to extend abstract service definition in a CompilerPass.
<?php
/**
* ShopCompilerPass.php
*
* @author Thomas Ploch <[email protected]>
* @since 17.01.13 14:26
* @filesource
*/
namespace Einblick\CoreShopBundle\DependencyInjection\Compiler;
@tPl0ch
tPl0ch / build.xml
Created December 2, 2012 03:51
Ant build file for PHP projects including Behat build task
<?xml version="1.0" encoding="utf-8"?>
<project name="your-project-name-here" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdox,phpunit,behat,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">