Skip to content

Instantly share code, notes, and snippets.


Jeroen De Dauw JeroenDeDauw

View GitHub Profile
View Maps.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View EntityRevisionLookup.php
interface EntityRevisionLookup {
public function getLatestRevisionId( EntityId $entityId, RevisionLookupResultHandler $resultHandler ): void;
// Interface version
// Great if you have anonymous classes
View LatestRevisionIdResult.php
class Result {
// Static constructors
public function isRedirect(): bool {
View DonationEvents.php
class DonationEvents {
private $donationCreatedCallbacks = [];
private $lolCatAddedCallbacks = [];
public function onDonationCreated( callable $callback ) {
$this->donationCreatedCallbacks[] = $callback;
View SharedObjectFactory.php
class SharedObjectFactory {
private $container;
private $config;
public function __construct( array $config ) {
$this->container = [];
$this->config = $config;
View PageContentFetcher.php
namespace Maps;
use MediaWiki\Storage\RevisionLookup;
* @licence GNU GPL v2+
* @author Jeroen De Dauw < >
JeroenDeDauw / php-collections.txt
Created Jun 19, 2017
Talking about PHP collections
View php-collections.txt
* dataProvider yield
* yield key
* yield from
* Inside out loop
* IteratorAggregate + Generator (MailTemplateFilenameTraversable)
* iterable
* iterable-functions
#! /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 mw-vagrant
cd mw-vagrant
View Seerose.txt
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
# Tested with Python 3.5
# Fails on 2.x
from unittest import TestCase, main
class Point:
def __init__(self, x, y):
self._x = x
You can’t perform that action at this time.