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 | |
interface UbiquitousLanguage | |
{ | |
public function enter(BoundedContext $boundedContext); | |
} | |
interface BoundedContext | |
{ | |
public function getNames(); |
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 | |
function flatten(array $array) | |
{ | |
return call_user_func_array('array_merge', $array); | |
} |
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 | |
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} |
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 Number // Immutable value object | |
{ | |
/** | |
* @param int $arabic | |
* @throws InvalidArgumentException | |
*/ | |
public function __construct($arabic) { /* ... */ } | |
/** |
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
#!/bin/bash | |
GIT_PS1_SHOWDIRTYSTATE=true | |
GIT_BRANCH_COLOR="\[\033[38;5;155m\]\[\033[48;5;235m\]" | |
PS1_EXIT_RED="\[\033[38;5;208m\]\[\033[48;5;52m\]" | |
# === Initializing static variables =========================================== | |
case $TERM in | |
xterm* | screen) | |
CORNER_TOP="\[\033(0l\033(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
c(order). | |
History1 = order:add_orderline([], 15). | |
History2 = order:add_orderline(History1, 50). | |
History3 = order:pay_for_order(History2, 20). | |
% ** exception throw: {payment_amount_is_too_small,{price,65}} | |
History3 = order:pay_for_order(History2, 65). | |
History3. |
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 | |
$addOne = partial(operator('+'), 1); | |
$double = partial(operator('*'), 2); | |
$greaterThan3 = partial(operator('>'), …(), 3); | |
assert( | |
map([1, 2, 3], $double)->§ | |
== [2, 4, 6] | |
); |
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 | |
define('map', 'map'); | |
function map($collection, $fn) { return array_map($fn, $collection); } | |
define('fold', 'fold'); | |
function fold($collection, $fn, $initial) { return array_reduce($collection, $fn, $initial); } | |
define('filter', 'filter'); | |
function filter($collection, $fn) { return array_filter($collection, $fn);} | |
function compose(array $collection, $fn, $args) |
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
### Keybase proof | |
I hereby claim: | |
* I am mathiasverraes on github. | |
* I am mathiasverraes (https://keybase.io/mathiasverraes) on keybase. | |
* I have a public key whose fingerprint is 3BCD D69A 3CBA E8EE 380A BA63 C938 C231 E989 3D78 | |
To claim this, I am signing this object: |