Skip to content

Instantly share code, notes, and snippets.

@keis
keis / gist:13e5753fc98a01d9acbc
Created August 20, 2014 13:03
or maybe monster regexp?
matcher = re.compile(r'''^
(?:(?P<prefix>\[.*\])\s+)?
(?P<name>.+?)
([._ ](?P<year>[0-9]{4}))?
([. ]
(?:(
[Ss](?P<season>[0-9]+)
(
[Ee](?P<episode>[0-9]+)
)?
@keis
keis / gist:ab22f0c8729720119025
Created November 25, 2014 15:00
dulwich find commit
#!/usr/bin/env python2
from dulwich.repo import Repo
from collections import defaultdict, deque
def changes_file(key):
def matches(commit, entry):
changes = entry.changes()
function capture(regex) {
return function (req, res, next, val, name) {
var capture;
console.log("name", name, "val", val);
if (capture = regex.exec(val)) {
req.params[name] = capture;
next();
} else {
@keis
keis / error-matcher.js
Created March 31, 2015 17:00
error matcher
var hamjest = require('hamjest')
, util = require('util')
, _ = require('lodash')
module.exports = error
function IsError(type, message) {
var prop = hamjest.hasProperty('message', message)
return _.create(new hamjest.TypeSafeMatcher(),

Keybase proof

I hereby claim:

  • I am keis on github.
  • I am keis (https://keybase.io/keis) on keybase.
  • I have a public key whose fingerprint is EB07 7310 9172 6FEF 40FC 70D0 5210 E90D 5F80 FC88

To claim this, I am signing this object:

SWEOSWIK - Ord som rekommenderas utvidgat nyttjande i samtliga kontext
oortodox
ooficill
utensil
KIWSOEWS - Ord vars användade vänligt men bestämt undanbedes
fokus
I annat sammanhang än optik
@keis
keis / meshy.patch
Created February 1, 2011 21:21
install stuff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1031631..d8f9b5c 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,10 +16,14 @@ endif()
if(WIN32)
set(CMAKE_MODULE_PATH "$ENV{OGRE_HOME}/CMake/;${CMAKE_MODULE_PATH}")
+ set(DATA_DIR bin/Release/Resources)
+ set(RELEASE_DIR bin/Release)
@keis
keis / miniscollbarbug
Created April 11, 2011 18:08
mod of gtklauncher that display the scrollbars bug with gtk+-3.0
/*
* Copyright (C) 2006, 2007 Apple Inc.
* Copyright (C) 2007 Alp Toker <alp@atoker.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@keis
keis / pyf
Created July 14, 2011 20:42
python pretty formater
#!/usr/bin/env python
import re
split = re.compile(r'(%[A-Z][^%]|%[^%])').split
def format(s, values):
return ''.join([str(values[k[1:]]) if k.startswith('%') else k for
k in split(s)])
if __name__ == '__main__':
@keis
keis / slideshow
Created July 20, 2011 19:03
uzbl slideshow
#!/bin/sh
static='slideshow'
queue='slideshow_temp'
uri=""
Zzz=5
if [ -z "$UZBL_FIFO" ]; then
echo "$0: error: set UZBL_FIFO before running"
exit 2