Skip to content

Instantly share code, notes, and snippets.

🐈
~=[,,_,,]:3

Jeroen De Dauw JeroenDeDauw

🐈
~=[,,_,,]:3
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
<?php
interface EntityRevisionLookup {
public function getLatestRevisionId( EntityId $entityId, RevisionLookupResultHandler $resultHandler ): void;
}
// Interface version
// Great if you have anonymous classes
View LatestRevisionIdResult.php
<?php
class Result {
// Static constructors
public function isRedirect(): bool {
}
View DonationEvents.php
<?php
class DonationEvents {
private $donationCreatedCallbacks = [];
private $lolCatAddedCallbacks = [];
public function onDonationCreated( callable $callback ) {
$this->donationCreatedCallbacks[] = $callback;
}
View SharedObjectFactory.php
<?php
class SharedObjectFactory {
private $container;
private $config;
public function __construct( array $config ) {
$this->container = [];
$this->config = $config;
View PageContentFetcher.php
<?php
namespace Maps;
use MediaWiki\Storage\RevisionLookup;
/**
* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
@JeroenDeDauw
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
iterable
View setup-mw-vagrant.sh
#! /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
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
View test_properties.py
# 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.