Skip to content

Instantly share code, notes, and snippets.

In your repositories, watching your code. Always watching.

Marco Pivetta Ocramius

In your repositories, watching your code. Always watching.
View GitHub Profile
View example.php
use Zend\Diactoros\Response;
use Zend\Diactoros\Server;
use Zend\Stratigility\MiddlewarePipe;
use function Zend\Stratigility\middleware;
require 'vendor/autoload.php';
$app = new MiddlewarePipe();
Ocramius / example.php
Created Jun 25, 2017 — forked from hikari-no-yume/example.php
function chaining for PHP 7
View example.php
<?php declare(strict_types=1);
require_once "✨.🐘";
Ocramius /
Created Jun 12, 2017 — forked from lelandbatey/
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


Ocramius /
Created Apr 9, 2017 — forked from grahamc/
NixOS on a Dell 15" 9560 with the 4K screen.
Ocramius / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Created Apr 9, 2017 — forked from whizzzkid/XPS-15 9560 Getting Nvidia To Work on KDE Neon
Making Nvidia Drivers + CUDA 8 + Bumblebee work together on XPS 15 Early 2017 9560 kabylake.
View XPS-15 9560 Getting Nvidia To Work on KDE Neon
# Update to 4.9 kernel do not delete the old kernel as it will be your failsafe if something happens to this one
# Install KabyLake graphics patches
cd /tmp;
tar xjvf kbldmcver101.tar.bz2; cd kbl_dmc_ver1_01/; sudo ./
cd /tmp;
tar xvzf kblgucver914.tar.gz; cd firmware/kbl/guc/kbl_guc_ver/; sudo ./
View CustomerRepository.php
interface CustomerRepository
public function isPremiumCustomer(CustomerId $customerId) : bool;
// ... more API (fetch collections, filter, etc):
public function findAllPremiumCustomer() : PremiumCustomersList;
public function findAllPremiumCustomerIds() : PremiumCustomersIdList;
Ocramius /
Created Jun 24, 2016 — forked from staltz/
The introduction to Reactive Programming you've been missing
Ocramius /
Created Apr 7, 2016 — forked from paulmillr/
Most active GitHub users (by contributions).

Most active GitHub users (

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at from Mon, 01 Dec 2014 00:48:25 GMT till Tue, 01 Dec 2015 00:48:25 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

  .filter(user => user.followers > 508)
View actions_cell_template.html
<div class="ngCellText" ng-class="col.colIndex()" style="padding-top:5px; padding-left:5px;">
<span ng-cell-text>
<button type="button" class="btn btn-sm btn-default" title="Edit peddler">
<span class="glyphicon glyphicon-edit"></span>
<button type="button" class="btn btn-sm btn-default" title="Pricing forumulas" ng-click="viewPricingFormulas()">
<span class="glyphicon glyphicon-usd"></span>
View entity-mapper-via-dynamic-proxy-object.php
namespace EntityMapperFramework {
class EntityMapper {
public function __construct() {
stream_wrapper_register('dynamicproxygenerator', __NAMESPACE__ . '\DynamicProxyGeneratorStream');
public function createProxy($entity) {
$class = get_class($entity);