Skip to content

Instantly share code, notes, and snippets.


Sylvain Machefert symac

View GitHub Profile
symac / contributionsUtilisateursRecents.js
Created Feb 18, 2016
script greasemonkey pour n'afficher que les utilisateurs recents ayant contribué.
View contributionsUtilisateursRecents.js
// ==UserScript==
// @name New users
// @namespace
// @version 0.1
// @description try to take over the world!
// @author You
// @matchécial%3AListe_des_utilisateur*
// @match*
// @match*
// @grant none
View proxy.php
if (isset($_GET["mimetype"]))
$type = $_GET["mimetype"];
$type = "";
print "Manque le mimetype";
symac /
Last active Jan 30, 2016
processing utf8 file
#!usr/bin/env python
# -*- coding: utf-8 -*-
import pymarc
fout = open("output.mrc", "wb")
reader = pymarc.MARCReader(open("D978421.USM"), force_utf8=True, utf8_handling='ignore')
for record in reader:
f001 = record.get_fields("001")[0].data
print f001
def list_template_usage(site, article_tpl_name):
"""Return a generator of main space pages transcluding a given template."""
rowTemplate = wikipedia.Page(site, u'%s:%s' % (site.namespace(10), article_tpl_name))
transGen = pagegenerators.ReferringPageGenerator(rowTemplate, onlyTemplateInclusion=True)
filteredGen = pagegenerators.NamespaceFilterPageGenerator(transGen, [0])
generator = pagegenerators.PreloadingGenerator(filteredGen)
return generator
site = wikipedia.getSite("en", 'wikipedia')
for page in list_template_usage(site, "Infobox person"):
View gist:cffcf1f9ab560b44a665
URL used:
EzProxy log: - h5opmRemBAz7vTh [24/Aug/2015:16:54:33 +0000] "GET
View stacktrace
Traceback (most recent call last):
File "", line 11, in <module>
for record in reader:
File "/usr/lib/python2.7/dist-packages/", line 535, in next
return type(self).__next__(self)
File "/usr/local/lib/python2.7/dist-packages/pymarc/", line 97, in __next__
File "/usr/local/lib/python2.7/dist-packages/pymarc/", line 72, in __init__
View cacheRender.php
public function fightCache(Request $request, Application $app, $p1, $p2, $Q1, $Q2, $format = "")
$md5_page = md5($request->getUri());
// We need to check the cache page
$cache_file = __DIR__."/../../cache/render/".$md5_page.".txt";
if (file_exists($cache_file))
return file_get_contents($cache_file);
View wd_query.js
function search_player(request, respond){
return $.ajax({
url: "",
data: {
search: request.term,
action: "wbsearchentities",
format: "json",
language: window.lang,
type: "item"
You can’t perform that action at this time.