Skip to content

Instantly share code, notes, and snippets.

View oqq's full-sized avatar
👽

Eric Braun oqq

👽
View GitHub Profile
@oqq
oqq / test.php
Last active November 8, 2016 10:10
AppendIterator test case
<?php
$iterator1 = new \AppendIterator();
$iterator2 = new \AppendIterator();
$events = new \ArrayIterator(['event']);
$iterator1->append($events);
$iterator2->append($events);
// without this foreach, i will not hang
#!/usr/bin/env php
<?php declare(strict_types=1);
$projectName = basename(getcwd());
echo <<<EOT
+ Starting unit tests for \033[1m\033[37;44m ${projectName} \033[0m.
EOT;
@oqq
oqq / MongoConnection.php
Created February 20, 2017 08:08 — forked from codeliner/MongoConnection.php
prooph MongoEventStore v7
<?php
declare(strict_types = 1);
namespace Acme\Infrastructure\MongoDb;
use MongoDB\Client;
use MongoDB\Collection;
class MongoConnection
@oqq
oqq / DocumentProjectionRunner.php
Created February 20, 2017 08:51
Example of an abstract ElasticSearchReadModel
<?php declare(strict_types = 1);
namespace Acme\Projection\Document;
use Acme\Domain\Document\Event\DocumentWasCreated;
use Acme\Domain\Document\Event\DocumentContentWasUpdated;
use Prooph\EventStore\EventStore;
use Prooph\EventStore\Projection\ReadModel;
final class DocumentProjectionRunner

Keybase proof

I hereby claim:

  • I am oqq on github.
  • I am oqq (https://keybase.io/oqq) on keybase.
  • I have a public key ASBqKNYOvCghs2bYs59OduFjQ8iP0oUpbJtFd048B4oXTAo

To claim this, I am signing this object:

@oqq
oqq / .zshrc
Last active October 18, 2017 14:18
Minikube Setup
export http_proxy=`scutil --proxy | awk '\
/HTTPEnable/ { enabled = $3; } \
/HTTPProxy/ { server = $3; } \
/HTTPPort/ { port = $3; } \
END { if (enabled == "1") { print "http://" server ":" port; } }'`
export https_proxy=`scutil --proxy | awk '\
/HTTPSEnable/ { enabled = $3; } \
/HTTPSProxy/ { server = $3; } \
/HTTPSPort/ { port = $3; } \
@oqq
oqq / CommandMiddleware.php
Created November 13, 2017 09:35
simple command middleware implementation using prooph components
<?php
declare(strict_types = 1);
namespace Acme\Middleware;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;
use Prooph\Common\Messaging\MessageFactory;
use Prooph\Psr7Middleware\MetadataGatherer;
@oqq
oqq / ProcessManagerPlugin.php
Created January 31, 2018 15:31
prooph event bus process manager plugin
<?php
declare(strict_types=1);
namespace Prooph\ServiceBus\Plugin;
use Prooph\Common\Event\ActionEvent;
use Prooph\ServiceBus\CommandBus;
use Prooph\ServiceBus\EventBus;
use Prooph\ServiceBus\MessageBus;
@oqq
oqq / prophecy.meta.php
Created October 10, 2018 16:36
PhpStorm meta file for Prophecy
<?php
namespace PHPSTORM_META {
override(\Prophecy\Argument::type(0),
map([
'' => '@',
])
);
override(\Prophecy\Argument::exact(0),