Skip to content

Instantly share code, notes, and snippets.

Avatar
🔬
In your repositories, watching your code. Always watching.

Marco Pivetta Ocramius

🔬
In your repositories, watching your code. Always watching.
View GitHub Profile
View tag-sync.php
<?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),
View keybase.md

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:

View AggregateTranslator.php
<?php
class AggregateTranslator implements YADDATranslator
{
/** @var YADDATranslator[] */
private $translators = [];
// ...
public function translate($string)
View roave.svg
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 Oct 6, 2014
my-thing protection module
View Module.php
<?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)
View entity-mapper-via-dynamic-proxy-object.php
<?php
namespace EntityMapperFramework {
class EntityMapper {
public function __construct() {
stream_wrapper_register('dynamicproxygenerator', __NAMESPACE__ . '\DynamicProxyGeneratorStream');
}
public function createProxy($entity) {
$class = get_class($entity);
View actions_cell_template.html
<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>
View AbstractTableGatewayFactory.php
<?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 Jan 9, 2015
ProxyManager generated GhostObject
View Foo54b039119141f998026307.php
<?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 Feb 24, 2015
EventSourcing for Angular Repository actions reflows
View example.js
(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);
}