Skip to content

Instantly share code, notes, and snippets.

View prolic's full-sized avatar
💭
Writing Haskell

Sascha-Oliver Prolic prolic

💭
Writing Haskell
View GitHub Profile
@prolic
prolic / gist:22ddcace2364be40e569cccecb0fe142
Last active October 7, 2017 14:58
event store benchmark results
mysql: set up event store tables on database event_store_tests
mariadb: set up event store tables on database event_store_tests
postgres: set up event store tables on database event_store_tests
arangodb: set up event store tables on database _system
test 1 create 10 streams with 100 events in each stream, using 1 event per commit
test 1 using mysql took 9.0940508842468 seconds
test 1 using mysql writes 109.9619974342 events per second
@prolic
prolic / benchmark.php
Created July 13, 2017 07:46
functional programming benchmarks in PHP
<?php
namespace f;
use ReflectionFunction;
const curry = 'f\curry';
function curry(callable $f, ...$args)
{
@prolic
prolic / gist:026caaad55e9f990cd4b2d5000e2735e
Last active November 12, 2016 10:26
create test-stream
<?php
/**
* This file is part of the prooph/event-store-http-api.
* (c) 2016-2016 prooph software GmbH <contact@prooph.de>
* (c) 2016-2016 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@prolic
prolic / l
Created March 9, 2016 18:43
amqp seg fault
git clone https://github.com/prolic/HumusAmqp
cd HumusAmqp
composer install
php -dzend_extension=xdebug.so ./vendor/bin/phpunit --coverage-html=html
// output
PHPUnit 5.2.10 by Sebastian Bergmann and contributors.
Runtime: PHP 7.0.3 with Xdebug 2.4.0
@prolic
prolic / confirm_test.php
Created March 7, 2016 21:06
Rabbitmq publisher confirm test
<?php
$connection1 = new \AMQPConnection();
$connection1->connect();
$connection2 = new \AMQPConnection();
$connection2->connect();
$channel1 = new \AMQPChannel($connection1);
@prolic
prolic / benchmark_batch_publishing.php
Created March 7, 2016 12:42
batch publishing benchmark
<?php
require 'vendor/autoload.php';
$amqpLibConnection = new \PhpAmqpLib\Connection\AMQPStreamConnection(
'localhost',
5672,
'guest',
'guest',
'/humus-amqp-test'
@prolic
prolic / gist:a320d43ee1ca709384fb
Last active February 25, 2016 12:45
inheritance aggregate root with prooph
A minor patch to the aggregate repository is needed for this! see: https://github.com/prooph/event-store/pull/154
<?php
abstract class User extends \Prooph\EventSourcing\AggregateRoot
{
protected $type;
public function type()
{
Verifying that +prolic is my blockchain ID. https://onename.com/prolic
@prolic
prolic / gist:65fc0bfd3792999ecd8b
Last active May 25, 2018 13:37
namespace organisation for ddd in bounded contexts
src
App
Commanding
Container
Querying
Rbac
BoundedContext1
Container
Infrastructure
Model
@prolic
prolic / CustomJsonApiSerializer.php
Created October 1, 2015 10:12
Custom JSON Api Serializer using Fractal and proxy pattern for https://github.com/thephpleague/fractal/pull/234
<?php
namespace My;
use League\Fractal\Pagination\CursorInterface;
use League\Fractal\Pagination\PaginatorInterface;
use League\Fractal\Resource\ResourceInterface;
use League\Fractal\Serializer\JsonApiSerializer;
class CustomJsonApiSerializer extends SerializerAbstract