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 / 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;
@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 / 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 / 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;

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 / 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