Skip to content

Instantly share code, notes, and snippets.

View najeira's full-sized avatar

najeira

View GitHub Profile
@najeira
najeira / gist:1341295
Created November 5, 2011 09:02
encode and decode between int,long and string by Python
import struct, base64
def long_to_str(value):
value = struct.pack('q', value)
value = base64.urlsafe_b64encode(value)
value = value.rstrip('=')
value = value.rstrip('A')
return value
@najeira
najeira / test.py
Created October 3, 2011 08:03
Check mediawiki responses for Tuningathon#2
# -*- coding: utf-8 -*-
import urllib
import urllib2
import time
MASTER_SERVER = '127.0.0.1'
PAGE_FORMAT = 'http://%s/mediawiki/index.php/%s'
TARGETS = [