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 DDC9999Test.php
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Tools\SchemaValidator;
use Doctrine\ORM\Tools\ToolsException;
* @coversNothing
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 / periodic-time-ticker.php
Last active Apr 14, 2017
A PHP long running process that fires a command at a command bus at regular time intervals
View periodic-time-ticker.php
#!/usr/bin/env php
namespace CodeReviewsIo\Worker;
use CodeReviewsIo\Domain\Command\TickTime;
use Prooph\ServiceBus\CommandBus;
use React\EventLoop\Factory;
View bootstrap.php
use Doctrine\DBAL\Driver\PDOSqlite\Driver;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\XmlDriver;
use Doctrine\ORM\Proxy\ProxyFactory;
use Ramsey\Uuid\Doctrine\UuidType;
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)
Ocramius / SubmitFakeStripeCreditCard.php
Last active Mar 16, 2016
Fake a stripe payment process in a Mink test context
View SubmitFakeStripeCreditCard.php
declare(strict_types = 1);
namespace MyApp\Web\Utility\Stripe;
use Behat\Mink\Session;
use MyApp\Domain\Payment\Stripe\PublishableKey;
use Zend\Escaper\Escaper;
Ocramius / psr-4-add.php
Last active May 30, 2018
Add a PSR-4 namespace to a composer.json file
View psr-4-add.php
#!/usr/bin/env php
['autoload' => ['psr-4' => [$argv[1] => $argv[2]]]],
json_decode(file_get_contents('composer.json'), true)
Ocramius / .gitignore
Last active Jul 22, 2017
PissOff: a valid, polite and useful alternative to the `void` return type in PHP
View .gitignore
Ocramius / .gitignore
Last active Apr 21, 2016
Benchmarking type-hinted variadic arguments versus looping+checking values
View .gitignore