Skip to content

Instantly share code, notes, and snippets.

Sam Reed reedy

  • Wikimedia Foundation
View GitHub Profile
View simon.py
import json
import requests
d = 0
for x in range(0, 114):
response = requests.request(
"GET",
"https://api.rebrandly.com/v1/links?apikey=<apikey>&offset=%d&orderBy=createdAt&orderDir=desc&" % (d)
).json()
View gist:73183c5f8285c740d9d1
public static function TimedMediaEncoding() {
global $wgEnabledTranscodeSet, $wgEnabledAudioTranscodeSet;
if ( $wgEnabledTranscodeSet != "OGV_160P" || $wgEnabledTranscodeSet != WebVideoTranscode::ENC_OGV_160P ) {
$derivativeSettings[WebVideoTranscode::ENC_OGV_160P] =
array(
'maxSize' => '288x160',
'videoBitrate' => '160',
'framerate' => '15',
'audioQuality' => '-1',
@reedy
reedy / updatetohead
Created Sep 24, 2014
Script to update mediawiki submodule to the head of its deployment branch
View updatetohead
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Usage: `basename $0` <branch> <extension>"
echo "e.g. `basename $0` 1.21wmf6 CodeReview"
exit
fi
PWD="`pwd`"
View keybase.md

Keybase proof

I hereby claim:

  • I am reedy on github.
  • I am tehreedy (https://keybase.io/tehreedy) on keybase.
  • I have a public key whose fingerprint is 1D98 867E 8298 2C8F E0AB C25F 9B69 B310 9D3B B7B0

To claim this, I am signing this object:

@reedy
reedy / gist:5397bb127ebb2b4e7eac
Last active Aug 29, 2015
mwgrep toolserver.org
View gist:5397bb127ebb2b4e7eac
reedy@tin:~$ mwgrep --max-results 350 toolserver.org
afwiki MediaWiki:Gadget-popups.js
afwiki MediaWiki:GeoHack.js
alswiki MediaWiki:Common.js
alswiki MediaWiki:Gadget-toolserver-integration.js
arcwiki MediaWiki:Gadget-popups.js
aswiki MediaWiki:Gadget-citations.js
barwiki MediaWiki:Common.css
be_x_oldwiki MediaWiki:Gadget-Popups.js
be_x_oldwiki MediaWiki:RefToolbar.js
View roadmap-publisher.py
#!/usr/bin/env python
#
# Copyright (c) 2013 Rob Lanphier, Wikimedia Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
View gist:4651983
class GuildWarsForeignAPIRepo extends ForeignAPIRepo {
function fetchImageQuery( $query ) {
global $wgMemc;
$query = array_merge( $query,
array(
'format' => 'json',
'action' => 'query'
) );
if ( $this->mApiBase ) {
You can’t perform that action at this time.