Skip to content

Instantly share code, notes, and snippets.

View alle's full-sized avatar

Alessandro Frangioni alle

View GitHub Profile
@alle
alle / Dockerfile
Created September 9, 2020 13:07 — forked from chriswales95/Dockerfile
Wordpress Dockerfile
FROM php:7.4-apache
# persistent dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# Ghostscript is required for rendering PDF previews
ghostscript \
; \
rm -rf /var/lib/apt/lists/*
@alle
alle / docker-compose.yml
Created September 9, 2020 13:05 — forked from chriswales95/docker-compose.yml
Mutagen compose example
version: "3.7"
services:
drupal:
depends_on:
- db
build: ./app
restart: unless-stopped
volumes:
- code:/app # mount the mutagen volume
environment:
<?php
declare(strict_types=1);
namespace App\Command;
use Prooph\Bundle\EventStore\Projection\ReadModelProjection;
use Prooph\EventStore\Projection\ProjectionManager;
use Prooph\EventStore\Projection\ReadModel;
use Prooph\EventStore\Projection\ReadModelProjector;
@alle
alle / composer-outdated.sh
Created February 22, 2019 18:38 — forked from Jean85/composer-outdated.sh
How to check in CI if any Composer dependency can be upgraded, using a committed file as a way to ignore upgrades blocked by external factors.
#!/usr/bin/env bash
for package in `composer outdated | awk '{ print $1":"$4 }'`;
do
echo "New version: $package" > outdated-status.txt
composer why-not $package > outdated-status.txt
echo "----------" > outdated-status.txt
done
if [ -z $(git status --porcelain) ];
<?php
declare(strict_types=1);
namespace Funct\Ion\Common\Library\Cqrs\ServiceBus;
use JsonSerializable;
use Prooph\Common\Messaging\Message;
final class IdentityCausationData implements JsonSerializable
<?php
class LockService
{
public function tryAcquireLocationLock(
LocationLock $lock,
IdInterface $owner,
?DateTimeImmutable $expirationDate
): bool {
try {
<?php
declare(strict_types=1);
namespace Funct\Ion\Microsite\Base\ReadModel\MicrositeCollections;
use Prooph\EventStore\Projection\AbstractReadModel;
use RuntimeException;
final class CombinedReadModel extends AbstractReadModel
@alle
alle / gist:bd2cd3b13284ff918a286e0236c40bc7
Created December 25, 2018 20:48 — forked from kunicmarko20/gist:9b21253ea86a49c94e3fba4b1de5fb54
PHPStorm code template for getters without `get` prefix and first letter decapitalized
#if (${TYPE_HINT} == "mixed")
/**
* @return ${TYPE_HINT}
*/
#end
public ${STATIC} function ${FIELD_NAME}()#if(${RETURN_TYPE}): ${RETURN_TYPE}#end
{
#if (${STATIC} == "static")
return self::$${FIELD_NAME};
#else
@alle
alle / ProcessManagerPlugin.php
Created March 17, 2018 16:27 — forked from oqq/ProcessManagerPlugin.php
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;
@alle
alle / CommandMiddleware.php
Created March 17, 2018 16:27 — forked from oqq/CommandMiddleware.php
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;