This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # wpt-side-by-side | |
| # ~~~~~~~~~~~~~~~~ | |
| # Generate a side-by-side comparison video from two WebPageTest runs. | |
| # | |
| # Usage: | |
| # wpt-side-by-side WEBPAGETEST_URL_1 WEBPAGETEST_URL_2 | |
| # | |
| # Requirements: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $loops = 1000; | |
| $data = array( 'a' => 1, 'b' => 2, 'c' => 3 ); | |
| // Memcached | |
| $cache = new Memcached(); | |
| $cache->addServer( "127.0.0.1", 11211 ); | |
| $start = microtime( true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import os.path | |
| import subprocess | |
| import urllib | |
| import urllib2 | |
| GERRIT_API = 'https://gerrit.wikimedia.org/r' | |
| query_string = urllib.urlencode(( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| KEYBOARD_KEXT="/System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/" | |
| countdown() { | |
| local seconds="$1" | |
| while [ $seconds -gt 0 ]; do | |
| sleep 1 & | |
| echo -n "${seconds}.. " | |
| seconds=$(( $seconds - 1 )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Check if libjemalloc was built with `--enable-prof` (and thus has | |
| memory profiling capabilities) or not. | |
| Author: Ori Livneh | |
| No copyright restriction | |
| """ | |
| import ctypes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Print the most recent IPython session to stdout. | |
| """ | |
| import sqlite3 | |
| import os | |
| HISTORY_FILE = '~/.ipython/profile_default/history.sqlite' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| with open('/etc/dsh/group/mediawiki-installation') as f: | |
| app_servers = [line.strip().split('.')[0] for line in f] | |
| num_servers = len(app_servers) | |
| def get_batch(): | |
| random.shuffle(app_servers) | |
| return app_servers[:num_servers // 10] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // run with: hhvm -vEval.Jit=1 bench.php | |
| require_once __DIR__ . '/maintenance/commandLine.inc'; | |
| $loops = 20; | |
| $warmups = 10; | |
| $times = array(); | |
| $title = Title::newMainPage(); | |
| $parserOptions = new ParserOptions(); | |
| $wikitext = file_get_contents( __DIR__ . '/quicksort.mediawiki' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| r = requests.get('https://meta.wikimedia.org/w/api.php?action=sitematrix&format=json') | |
| wikis = r.json()['sitematrix'].values() | |
| sites = {} | |
| for wiki in wikis: | |
| if not isinstance(wiki, dict) or 'site' not in wiki: | |
| continue | |
| for site in wiki['site']: | |
| if 'dbname' not in site: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DocumentRoot /srv/mediawiki | |
| <Directory /srv/mediawiki> | |
| Require all granted | |
| </Directory> | |
| AllowEncodedSlashes on | |
| RewriteEngine On | |
| ProxyPass /wiki fcgi://127.0.0.1:9000/srv/mediawiki/index.php retry=0 |