Skip to content

Instantly share code, notes, and snippets.

Matthias Vogelgesang matze

Block or report user

Report or block matze

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matze
matze / pass.py
Created Sep 4, 2017
Comparison of search algorithms
View pass.py
import os
import sys
import re
import difflib
store = os.path.abspath('/home/matthias/dev/password-store/')
def get_password_names_old(name):
names = []
@matze
matze / Makefile
Created Dec 15, 2014
Kobo Hyphenation
View Makefile
DICT_DIR=usr/local/Kobo/hyphenDicts
all: KoboRoot.tgz
KoboRoot.tgz:
@mkdir -p $(DICT_DIR)
@cp -P /usr/share/hyphen/*.dic $(DICT_DIR)
@find $(DICT_DIR) -type l -exec rm -f {} \;
@tar czf $@ usr/
View trace.json
{"traceEvents": [{"name": "foo", "tid": 140094068987648, "ph": "B", "pid": 11403, "ts": 463.9625549316406, "cat": "f"}, {"name": "foo", "tid": 140094060594944, "ph": "B", "pid": 11403, "ts": 24585.962295532227, "cat": "f"}, {"name": "foo", "tid": 140093981456128, "ph": "B", "pid": 11403, "ts": 32024.860382080078, "cat": "f"}, {"name": "foo", "tid": 140093973063424, "ph": "B", "pid": 11403, "ts": 45877.933502197266, "cat": "f"}, {"name": "foo", "tid": 140093964670720, "ph": "B", "pid": 11403, "ts": 70307.01637268066, "cat": "f"}, {"name": "foo", "tid": 140093956278016, "ph": "B", "pid": 11403, "ts": 84609.9853515625, "cat": "f"}, {"name": "foo", "tid": 140093947885312, "ph": "B", "pid": 11403, "ts": 93953.84788513184, "cat": "f"}, {"name": "foo", "tid": 140093964670720, "ph": "E", "pid": 11403, "ts": 94250.91743469238, "cat": "f"}, {"name": "foo", "tid": 140093964670720, "ph": "B", "pid": 11403, "ts": 99001.88446044922, "cat": "f"}, {"name": "foo", "tid": 140093939492608, "ph": "B", "pid": 11403, "ts": 111577.
@matze
matze / Makefile
Last active Aug 29, 2015
HDF5 performance
View Makefile
SRC = perf.c
BIN = perf
PKG_DEPS = glib-2.0
LDFLAGS = -lhdf5
include c.mk
@matze
matze / gist:c8c509f836732427e78c
Last active Aug 29, 2015
Support flat files and hdf5
View gist:c8c509f836732427e78c
import os
import h5py
import numpy as np
def touch(fname, data):
f = open(fname, 'w')
f.close()
View keybase.md

Keybase proof

I hereby claim:

  • I am matze on github.
  • I am matze (https://keybase.io/matze) on keybase.
  • I have a public key whose fingerprint is DD89 68B2 F64F 0260 A387 5EE0 018A 1479 4D3A 8106

To claim this, I am signing this object:

@matze
matze / gist:8971104
Created Feb 13, 2014
Comment spam template – something went wrong with this bot
View gist:8971104
{I have|I've} been {surfing|browsing} online more than {three|3|2|4}
hours today, yet I never found any interesting article like yours.
{It's|It is} pretty worth enough for me. {In my opinion|Personally|In my view},
if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot
more} useful than ever before.|
View gist:8860802
class State(object):
def __init__(self, default=None):
self.default = default
def __get__(self, instance, owner):
return self._value(instance)
def _value(self, instance):
if not hasattr(instance, '_state_value'):
setattr(instance, '_state_value', self.default)
View gist:7672662
import time
import gevent
import functools
class GreenletRunner(gevent.Greenlet):
def __init__(self, func, args, kwargs):
super(GreenletRunner, self).__init__()
self.func = func
@matze
matze / ConfigurePaths.cmake
Created Oct 28, 2013
configure-like path handling for CMake
View ConfigurePaths.cmake
# - pre-configured paths for CMake
#
# Usage:
# configure_paths(<PREFIX>)
#
# Checks if configure-like prefix and installation paths were passed by the user
# and sets up corresponding variables for use in install() commands and to fill
# out .pc files:
#
# PREFIX_PREFIX defaults to ... CMAKE_INSTALL_PREFIX
You can’t perform that action at this time.