Skip to content

Instantly share code, notes, and snippets.

View druid628's full-sized avatar

Micah Breedlove druid628

View GitHub Profile
<?php
function curry(\Closure $f)
{
$a = [];
$t = 'function($%s) use ($f, $a) { $a[] = $%s; return %s };';
return eval('return '
.array_reduce(
array_reverse((new \ReflectionObject($f))->getMethod('__invoke')->getParameters()),
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*