- https://joind.in/talk/view/13174
- http://ddd.io/2015/01/26/review-of-the-unofficial-ddd-track-for-phpbenelux-2015/
- http://www.freeklijten.nl/home/2015/01/24/PHP-Benelux-conference
- https://twitter.com/sgrame/status/558954481359282176/photo/1
- http://www.future500.nl/articles/2015/01/phpbenelux-2015-revisited/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class Basket implements RecordsEvents | |
{ | |
private $basketCanOnlyContainFiveProducts; | |
private function __construct() | |
{ | |
$this->basketCanOnlyContainFiveProducts = new BasketCanOnlyContainFiveProducts(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(bla). | |
-compile(export_all). | |
a_friend(_, []) -> false; | |
a_friend(_, _) -> true. | |
main() -> | |
multiremberco(tuna, [strawberries, tuna, swordfish], fun a_friend/2). | |
multiremberco(_Atom, [], Cont) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . 'path/to/src/Verraes/Lambdalicious/load.php'; | |
assert( | |
isatom(@my_atom) | |
); | |
atom(@my_atom); | |
assert( | |
isatom(my_atom) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/../src/Verraes/Lambdalicious/load.php'; | |
// non generic, only deals with functions with arity=2 | |
function curry($f) { | |
return function($x) use($f) { | |
return function($y) use($f, $x) { | |
return $f($x, $y); | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dispatcher = new EventDispatcher; | |
class SendWelcomeEmail implements QueuedEventHandler { | |
public function when(Event $event) { | |
// delegate to whenUserHasRegistered, whenFoo.. | |
} | |
private function whenUserHasRegistered(UserHasRegistered $event) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// test data | |
class Foo { | |
private $a; | |
private $b; | |
function __construct($a, $b) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass | |
{ | |
/** | |
* Lots of comments | |
*/ | |
public function importantMethodAtTheTop() | |
{ // braces on new lines | |
// lots of newlines to create structure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$request = \Zend\Http\Request::fromString( | |
<<<REQ | |
GET /?foo=bar HTTP/1.1\r\n\r\n | |
REQ | |
); | |
var_dump($request->getQuery()->get('foo')); | |
// Expected "bar", got null |
GitHub provides a special pulls remote "namespace" on the upstream repo, so you can add it as a fetch pattern to your .git/config like so:
[remote "upstream"]
url = https://github.com/neovim/neovim.git
fetch = +refs/heads/*:refs/remotes/upstream/*
fetch = +refs/pull/*/head:refs/pull/upstream/*
Then when you git fetch --all
, you will have ALL pull requests available in your local repo in the local pull/ namespace. To check out PR #42: