This file contains 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 | |
namespace Maps; | |
use MediaWiki\Storage\RevisionLookup; | |
/** | |
* @licence GNU GPL v2+ | |
* @author Jeroen De Dauw < [email protected] > | |
*/ |
This file contains 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
* dataProvider yield | |
* yield key | |
* yield from | |
* Inside out loop | |
* IteratorAggregate + Generator (MailTemplateFilenameTraversable) | |
* iterable | |
* iterable-functions | |
iterable |
This file contains 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 | |
# Sets up MediaWiki Vagrant in a subdirectory named mw-vagrant | |
# When aksed for a git user, just hit enter. Entering "anonymous" does not work. | |
set -ex | |
git clone --recursive https://gerrit.wikimedia.org/r/mediawiki/vagrant mw-vagrant | |
cd mw-vagrant |
This file contains 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
Big salad: | |
25% cous cous | |
15% chick peas | |
15% white beans | |
15% carrots with nuts | |
15% lentils | |
15% the thing that looks like lentils and is in between them and the chick peas | |
No dressing |
This file contains 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
# Tested with Python 3.5 | |
# Fails on 2.x | |
from unittest import TestCase, main | |
class Point: | |
def __init__(self, x, y): | |
self._x = x |
This file contains 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
# Tested with Python 3.5 | |
from unittest import TestCase, main | |
from collections import namedtuple | |
import math | |
class Point(namedtuple('Point', 'x, y')): | |
def get_distance_from_origin(self): |
This file contains 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
* Domain Model (Entities, value objects, aggregates) depends on "nothing" (PHP, possibly libraries such as Euro) | |
* Domain Services are defined as interfaces that can only depend, and always depend, on domain concepts (and the domain model) | |
* Repositories (a kind of Domain Service?) are defined as interfaces that can only depend, and always depend, on domain concepts (and the domain model) | |
* Implementations of Repositories and Domain Services can depend on whatever (ie Doctrine, Monolog) | |
* Use Cases can only depend on the Domain Model, Domain Service (interfaces) and Repositories (interfaces) | |
* Use Cases form the API to the Domain. Higher level code cannot directly access the domain / domain concepts should not occur "outside" UCs. | |
* Everything bound to the Domain is part of the Bounded Context, nothing else is | |
* If there are multiple Domains (or rather, Sub Domains), there are multiple Bounded Contexts | |
* There are no dependencies between Bounded Contexts | |
* (Applications can use one or more Bounded Contexts, w |
This file contains 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
trait ValueObjectsInPhpStuckBalls { | |
public static function newInstance() { | |
return new self(); | |
} | |
/** | |
* @throws \RuntimeException | |
*/ | |
public function validate() { |
This file contains 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
data: { | |
"sister city": { | |
"type": "string", | |
"value": "Berlin", | |
"values": [ | |
"Berlin", | |
"Brussels" | |
] | |
} | |
} |