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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 ...