Skip to content

Instantly share code, notes, and snippets.

Sam Smith phuedx

  • Bournemouth, United Kingdom
Block or report user

Report or block phuedx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
phuedx / main.js
Created Feb 12, 2019
Toy MediaWiki EventLogging catter
View main.js
const PORT = 8035;
const http = require('http');
const url = require('url');
const server = http.createServer((req, res) => {
const i = req.url.indexOf('?');
let rawEvent = req.url;
// The EventLogging client doesn't specify a name for the query parameter
phuedx / boogy.js
Last active Aug 11, 2017
MediaWiki experiment session generator!!1
View boogy.js
(function () {
// ---
// ---
const experiment = {
enabled: true,
name: 'ext.Popups.instrumentation.eventLogging',
buckets: {
phuedx / InitialiseSettings.php
Last active May 3, 2017
Go Go Gadget Gadgets
View InitialiseSettings.php
// Generated by go_go_gadget_export.php.
'wgPopupsConflictingNavPopupsGadgetName' => [
'af' => 'popups',
'av' => 'popups',
'az' => 'popups',
'azb' => 'popups',
'be' => 'popups',
phuedx / Barack_Obama.js
Last active Dec 23, 2015
The sizes of Parsoid- and non-Parsoid-generated (very nearly almost all Cite-generated) element IDs on
View Barack_Obama.js
// $ curl -so /dev/null -w '%{size_download}'
var TOTAL_BYTES = 1582727;
function total_bytes_for_ids(ids) {
return ids.reduce(
// 5 additional bytes for the "id=''" string
(acc, id) => acc + id.length + 5,
phuedx /
Last active Jan 11, 2020
Feature life cycle

Feature life cycle


Patch: Developers submit a patch, sometimes with dependencies, to Gerrit. The patches are currently based off of the master branch and are merged to the master branch after they've been reviewed

Master: What gets deployed to production

Beta cluster: A test wiki that syncs the master branches of many extensions approximately every ten minutes, which is available at The Release Engineering team run browser tests against the beta cluster every night

phuedx /
Last active Aug 29, 2015
Dumb WikiGrok claim aggregation script
import csv
import hashlib
raw_claims = open('claims.tsv', 'r')
claims = csv.DictReader(raw_claims, delimiter='\t')
aggregated_claims = {}
for claim in claims:
hash = hashlib.md5()
phuedx /
Last active Aug 29, 2015
Notes from pairing with @MaxSem on getting WikiGrok working on mediawiki-vagrant.

Before enabling the wikidata role and provisioning set refreshonly = false in the wikidata-populate-site-tables in /path/to/mediawiki-vagrant/puppet/modules/role/manifests/wikidata.pp to ensure that SiteMatrix is up to date.

vagrant enable-role wikidata && vagrant provision

Ensure that Wikidata has appeared in the SiteMatrix (

vagrant provision doesn't notice schema updates so: vagrant ssh -- foreachwiki update.php --quick

Create a property, e.g. "instance of". Make sure that it has Data type: item.

phuedx / api.php
Created Feb 4, 2015
php DocThor.php --sourceDir=php-zmq zmq > api.php
View api.php
* zmq-API v@PACKAGE_VERSION@ Docs build by DocThor [2015-02-04]
* @package zmq
* @package zmq
class ZMQ {
phuedx / MyAwesomeFeature.experiment
Last active Aug 29, 2015
Can we repurpose the Gherkin syntax to define simple experiments?
View MyAwesomeFeature.experiment
Experiment: version
Given the user is logged in
Then they should have a 70% chance of being "A"
And they should have a 30% chance of being "B"
phuedx / effective_tld_names.dat
Created Nov 5, 2014
Find the highest level part of the host that isn't a public suffix as listed at
View effective_tld_names.dat
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at
// ac :
You can’t perform that action at this time.