Skip to content

Instantly share code, notes, and snippets.

View martinth's full-sized avatar

Martin Thurau martinth

View GitHub Profile
@martinth
martinth / Dota 2 winrates.ipynb
Created August 31, 2015 09:55
Dota 2 winrates 6.84 pro and pub
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from pympler import summary, muppy
import psutil
# source: http://www.mobify.com/blog/sqlalchemy-memory-magic/
def get_virtual_memory_usage_kb(): # pragma: no cover
"""
The process's current virtual memory size in Kb, as a float.
"""
class Range(object):
"""Represents an integer range"""
regex = re.compile(r'(?P<low>\d+|-\d+)?\.\.(?P<high>\d+|-\d+)')
def __init__(self, low, high):
self.low = low
self.high = high
@martinth
martinth / userscript.js
Created February 4, 2015 11:07
SCP Foundation reading helper
// ==UserScript==
// @name SCP Foundation reading helper
// @namespace http://hrnz.net/
// @version 0.1
// @description Adds simple buttons to SCP page to allow easy paging.
// @author Martin Thurau <martin.thurau@gmail.com>
// @match http://www.scp-wiki.net/scp-*
// @grant unsafeWindow
// @grant GM_addStyle
// @grant GM_setValue