Skip to content

Instantly share code, notes, and snippets.

View prolic's full-sized avatar
💭
Writing Haskell

Sascha-Oliver Prolić prolic

💭
Writing Haskell
View GitHub Profile
@prolic
prolic / ZfClassmapTask.php
Created January 23, 2012 11:40 — forked from shevron/ZfClassmapTask.php
Zend Framework 2.0 style autoloader classmap generator task for Phing
<?php
/**
* Phing task to generate a Zend Framework style autoloader classmap file
*
* This task requires ZF 2.x to be in your include_path. You can run phing like
* so to enforce this:
*
* $ export PHP_COMMAND="php -d include_path=.:<path to zf library>:<path to pear>"
* $ phing ...
@prolic
prolic / acllistener.php
Created February 29, 2012 12:10
ACL Listener
<?php
namespace Application\Event;
use Zend\EventManager\StaticEventManager,
Zend\EventManager\EventDescription,
Application\Event\Exception\ForbiddenException,
Application\Event\Exception\UnexpectedValueException,
Humus\Di\Locator;
@prolic
prolic / index.php
Created April 27, 2012 13:06
Generate a service locator when in development mode
$config; // array with di configuration
if (APPLICATION_ENV == 'development' || !class_exists('Application\Context') {
$di = new Zend\Di\Di($config);
$generator = new Generator($di);
$generator->setNamespace('Application')
->setContainerClass('Context');
$file = $generator->getCodeGenerator();
$file->setFilename(__DIR__ . '/../Application/Context.php');
$file->write();
@prolic
prolic / context.php
Created April 29, 2012 18:51
Generated locator
<?php
namespace Application;
use Zend\Di\Di;
class Context extends Di
{
public function newInstance($name, array $params = array(), $isShared = true)
@prolic
prolic / test.php
Created July 11, 2012 11:22
performance test on different isSubclassOf implementations
<?php
// our test cases
interface A {}
class B implements A {}
class C extends B {}
@prolic
prolic / gist:6776700
Last active August 9, 2016 13:44
gitlab nginx config
upstream jenkins {
server 127.0.0.1:8081 fail_timeout=0;
}
upstream gitlab {
## Uncomment if you have set up puma/unicorn to listen on a unix socket (recommended).
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
## Uncomment if puma/unicorn are configured to listen on a tcp port.
@prolic
prolic / rotate-screen.sh
Created February 22, 2015 16:23
Lenovo Yoga 3 Pro rotate script for linux
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ATML1000:00 03EB:8A10'
TouchpadDevice='SYNA2B22:00 06CB:2714'
@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
@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
Verifying that +prolic is my blockchain ID. https://onename.com/prolic