Skip to content

Instantly share code, notes, and snippets.

View Ocramius's full-sized avatar
🔬
In your repositories, watching your code. Always watching.

Marco Pivetta Ocramius

🔬
In your repositories, watching your code. Always watching.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am Ocramius on github.
  • I am ocramius (https://keybase.io/ocramius) on keybase.
  • I have a public key whose fingerprint is 7BB9 B50F E8E0 2118 7914 A5C0 9F65 FBC2 12EC 2DF8

To claim this, I am signing this object:

<?php
$componentsPath = __DIR__ . '/vendor/zendframework'; // assuming vendor packages were installed here via composer + --prefer-source
$zfPath = __DIR__ . '/zf2'; // assuming the framework was installed here
$tag = 'release-2.3.0'; // tag to be used
$remote = 'origin';
$findVendorComponents = function ($path) {
new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path),
<?php
class AggregateTranslator implements YADDATranslator
{
/** @var YADDATranslator[] */
private $translators = [];
// ...
public function translate($string)
@Ocramius
Ocramius / roave.svg
Created May 8, 2014 02:09
Roave Logo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ocramius
Ocramius / Module.php
Created October 6, 2014 18:56
my-thing protection module
<?php
use Zend\EventManager\EventInterface;
use Zend\ModuleManager\Feature\BootstrapListenerInterface;
use Zend\Mvc\MvcEvent;
use Zend\Http\Response;
class Module implements BootstrapListenerInterface
{
public function onBootstrap(EventInterface $event)
<?php
namespace EntityMapperFramework {
class EntityMapper {
public function __construct() {
stream_wrapper_register('dynamicproxygenerator', __NAMESPACE__ . '\DynamicProxyGeneratorStream');
}
public function createProxy($entity) {
$class = get_class($entity);
<div class="ngCellText" ng-class="col.colIndex()" style="padding-top:5px; padding-left:5px;">
<span ng-cell-text>
{{console.log(row)}}
{{row.getProperty(col.id)}}
<button type="button" class="btn btn-sm btn-default" title="Edit peddler">
<span class="glyphicon glyphicon-edit"></span>
</button>
<button type="button" class="btn btn-sm btn-default" title="Pricing forumulas" ng-click="viewPricingFormulas()">
<span class="glyphicon glyphicon-usd"></span>
<?php
namespace MyModule;
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\Filter\Word\CamelCaseToUnderscore;
use Zend\Db\Resultset\HydratingResultSet;
use Zend\Stdlib\Hydrator\ClassMethods;
@Ocramius
Ocramius / Foo54b039119141f998026307.php
Created January 9, 2015 20:25
ProxyManager generated GhostObject
<?php
namespace ProxyManagerTest\Functional;
class Foo54b039119141f998026307 extends \ProxyManagerTestAsset\ClassWithCollidingPrivateInheritedProperties implements \ProxyManager\Proxy\GhostObjectInterface
{
/**
* @var \Closure|null initializer responsible for generating the wrapped object
*/
@Ocramius
Ocramius / example.js
Created February 24, 2015 22:13
EventSourcing for Angular Repository actions reflows
(function (exports) {
function EventBus() {
this.handlers = [];
}
EventBus.prototype.push = function (event) {
foreach (idx in this.handlers) {
if (this.handler[idx].canHandle(event)) {
this.handler[idx].handle(event);
}