Skip to content

Instantly share code, notes, and snippets.

@hashar
hashar / ssh_config
Created July 26, 2013 13:52
SSH config to connect to Wikimedia Labs instances
Host *.wmflabs.org
IdentityFile ~/.ssh/labs_id_rsa.pub
IdentitiesOnly yes
User hashar
Host *.wmflabs
User hashar
Host bastion.pmtpa.wmflabs
Hostname bastion.wmflabs.org
hashar@gallium:~$ tail -n15 /srv/ssd/jenkins-slave/workspace/mwext-Wikibase-qunit/LocalSettings.php
# End of automatically generated settings.
# Add more configuration options below.
$wgWikimediaJenkinsCI = true;
require_once( '/var/lib/jenkins/tools/extensions-loader.php' );
ini_set( 'display_errors', 1 );
@hashar
hashar / gist:7215603
Created October 29, 2013 14:22
are function args in exceptions traced passed by reference?
<?php
# Example for https://gerrit.wikimedia.org/r/#/c/92334/
function blame($a) {
throw new Exception();
}
try {
blame( array('foobar') );
} catch (Exception $e) {
@hashar
hashar / CommonSettings.php
Created October 30, 2013 20:37
CommonSettings.php for a hacker local MediaWiki install
<?php
$wgDebugDumpSql = false;
$wgAllowUserCss = true;
$wgDebugTimestamps = true;
#$wgDebugToolbar = true; # true: no file cache!
$wgDevelopmentWarnings = true;
$wgEnableJavaScriptTest = true;
@hashar
hashar / out.txt
Created July 1, 2014 11:27
Bug: 67148
TAP version 13
ok 1 - BatchRowUpdateTest::testWriterBasicFunctionality
ok 2 - BatchRowUpdateTest::testReaderBasicIterate
ok 3 - BatchRowUpdateTest::testReaderGetPrimaryKey with data set #0 ('Must return single column pk when requested', array(42), array(42, 'dvorak', 'samurai'))
ok 4 - BatchRowUpdateTest::testReaderGetPrimaryKey with data set #1 ('Must return multiple column pks when requested', array(42, 'samurai'), array(42, 'dvorak', 'samurai'))
ok 5 - BatchRowUpdateTest::testReaderSetFetchColumns with data set #0 ('Must merge primary keys into select conditions', array('foo', 'bar'), array('foo'), array('bar'))
ok 6 - BatchRowUpdateTest::testReaderSetFetchColumns with data set #1 ('Must not merge primary keys into the all columns selector', array('*'), array('foo'), array('*'))
ok 7 - BatchRowUpdateTest::testReaderSetFetchColumns with data set #2 ('Must not duplicate primary keys into column selector', array('foo', 'bar', 'baz'), array('foo', 'bar'), array('bar', 'baz'))
ok 8 - BatchRowUpdateTest::testRe
@hashar
hashar / monkeyprogress.py
Created July 24, 2014 21:24
monkeys based spinner
import sys
import time
monkeys = [
u'\U0001F648',
u'\U0001F649',
u'\U0001F64A',
]
try:
@hashar
hashar / 503waitdancing.py
Created October 6, 2015 20:47
Wait for 503 for a few seconds while dancing
#!/usr/bin/env python3
import random
import time
arm = 'v^<>'
eye = '^Oo*'
body = '\r%s(%s%s)%s'
#!/usr/bin/env python3
import random
import time
arm = 'v^<>'
eye = '^Oo*'
body = '\r%s(%s%s)%s'
<?php
# Acknowledging Stas Malyshev
# https://phabricator.wikimedia.org/T156364#2977719
# Given two classes with the same property name but different visibility
class WithPublic {
public $property;
function __construct( $p ) { $this->property = $p; }
function getProperty() { print $this->property; }
}