Skip to content

Instantly share code, notes, and snippets.

View alle's full-sized avatar

Alessandro Frangioni alle

View GitHub Profile
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Mongo Auth driver. Adapted from Kohana_Auth_ORM.
*/
class Auth_Mongo extends Auth {
/**
* Checks if a session is active.
*
* @param string role name
@alle
alle / install-kohana.sh
Created October 18, 2011 09:25 — forked from sebacruz/install-kohana.sh
A script to install the Kohana PHP Framework
#!/bin/sh
# have submodules been added?
MODS=0
# Github base URL
GITHUB="https://github.com"
# Default branch
DEFAULT_BRANCH="3.0/master"
@alle
alle / config.js
Created December 6, 2013 09:14
changing directive template with decorator (for ng-YouTubeAPI.js), like http://angular-tips.com/blog/2013/09/experiment-decorating-directives/
app.config(function($provide) {
$provide.decorator('ytPlaytoDirective', function($delegate) {
var directive = $delegate[0];
directive.template = '<h5>{{ title }}, {{ viewCount }}</h5>';
return $delegate;
});
});
@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;
@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;
<?php
class LockService
{
public function tryAcquireLocationLock(
LocationLock $lock,
IdInterface $owner,
?DateTimeImmutable $expirationDate
): bool {
try {
<?php
declare(strict_types=1);
namespace Funct\Ion\Common\Library\Cqrs\ServiceBus;
use JsonSerializable;
use Prooph\Common\Messaging\Message;
final class IdentityCausationData implements JsonSerializable
@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 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 / 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: