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 -*- | |
| import fileinput | |
| from datetime import datetime | |
| print '<!-- generated: %s -->' % datetime.strftime(datetime.now(), '%Y-%m-%dT%H:%M:%SZ') | |
| for line in fileinput.input(): | |
| ns,page,n = line.strip().split('\t') | |
| print '# [[%s]] ([[特別:Whatlinkshere/%s|%s 個のリンク]])' % (page, page, n) |
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 ruby | |
| # download Wikimedia rev diff dumps, giving a different limit rate depending on day/night, and output md5sum to stdout | |
| require 'open-uri' | |
| require 'optparse' | |
| require 'time' | |
| USAGE= <<'END' | |
| usage: download.rb http://dumps.wikimedia.org/enwiki/20111201/ --day-limit-rate=500k > checksums.txt |
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 -*- | |
| # splitting revision diffs into files whose file names are the revision IDs | |
| # see http://meta.wikimedia.org/wiki/WSoR_datasets/revision_diff for the input | |
| import csv | |
| import argparse | |
| import sys | |
| import os |
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 | |
| /* | |
| Rewrite of CatScan for Wikimedia Deutschland | |
| (c) 2009 by Magnus Manske | |
| Released under GPL | |
| */ | |
| error_reporting(E_ERROR|E_CORE_ERROR|E_ALL|E_COMPILE_ERROR); | |
| ini_set('display_errors', 'On'); |
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
| for i in `seq_p 1001 5006`; do wget http://www.aclweb.org/anthology/P/P11/P11-$i.pdf ; done && \ | |
| pdfjam P11-*.pdf 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 -*- | |
| # assign latitude and longtude for <location> tags | |
| # 使い方: | |
| # | |
| # 1. このファイルをanpi_geocode.pyとして保存する。 | |
| # 2. http://code.google.com/p/geopy/ をインストール(Pythonのeasy_install、またはソースから)。 | |
| # 3. http://code.google.com/intl/ja/apis/maps/signup.ht で取得したAPIキーを変数 apikey に代入。 |
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
| # see also http://www.mediawiki.org/wiki/Manual:Timezone#Primary_Method | |
| #Set Default Timezone | |
| $wgLocaltimezone = "Asia/Tokyo"; | |
| $oldtz = getenv("TZ"); | |
| putenv("TZ=$wgLocaltimezone"); | |
| # Versions before 1.7.0 used $wgLocalTZoffset as hours. | |
| # After 1.7.0 offset as minutes | |
| $wgLocalTZoffset = date("Z") / 60; | |
| putenv("TZ=$oldtz"); |
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
| #include <iostream> | |
| #include <sstream> | |
| #include <fstream> | |
| #include <cstring> | |
| #include <cstdlib> | |
| #define PREFIX "/tmp/frag." | |
| #define BLOCKSIZE 16384 | |
| const char* bytesbytes(const char* a, const char* b, size_t as, size_t bs) { |
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 ruby | |
| # insert dummy DNS entries for the domains specified in LeechBlock for Firefox | |
| # usage: use this as a cron job | |
| USAGE = <<"EOD" | |
| usage: #{$0} [-f leechblock_exported_file] | |
| EOD |
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 ruby | |
| # -*- coding: utf-8; mode: ruby -*- | |
| # TODO: rewrite referring Range | |
| class Annotation | |
| include Comparable | |
| attr_reader :start, :end, :tag | |
| attr_writer :start, :end, :tag |