Skip to content

Instantly share code, notes, and snippets.

View lorenzhs's full-sized avatar

Lorenz Hübschle lorenzhs

View GitHub Profile
# license: BSD 2-clause
# author: Lorenz H-S
class Point
visited: false
cluster: -1
constructor: (@x, @y) ->
toString: () ->
"(" + @x + "," + @y + "/" + @cluster + ")"
@lorenzhs
lorenzhs / sepa.py
Last active December 20, 2015 09:19
Kontonummer / BLZ to IBAN / BIC converter
# coding: utf-8
# author: Lorenz H-S (github.com/lorenzhs)
# license: 3-clause BSD
import re
import urllib2
from datetime import date
import codecs
from collections import defaultdict
import sys
@lorenzhs
lorenzhs / relay-server.c.diff
Created April 6, 2014 08:55
WeeChat Relay TCP keepalive interval
diff --git a/src/plugins/relay/relay-server.c b/src/plugins/relay/relay-server.c
index 900ecf9..c64bcaa 100644
--- a/src/plugins/relay/relay-server.c
+++ b/src/plugins/relay/relay-server.c
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <arpa/inet.h>

Keybase proof

I hereby claim:

  • I am lorenzhs on github.
  • I am lorenz (https://keybase.io/lorenz) on keybase.
  • I have a public key whose fingerprint is 7871 0F91 B81A D783 A314 6481 2452 F4DF D3FC 902C

To claim this, I am signing this object:

@lorenzhs
lorenzhs / gist:bf6e832fe40cabb4efed
Last active August 29, 2015 14:01
GitHub Pages WAT
19:34 Wed 7% curl -sI https://glowing-bear.github.io/glowing-bear | grep -E '(HTTP|Location)'
HTTP/1.1 301 Moved Permanently
Location: http://glowing-bear.github.io/glowing-bear/
19:34 Wed 7% curl -sI https://glowing-bear.github.io/glowing-bear/ | grep -E '(HTTP|Location)'
HTTP/1.1 200 OK
@lorenzhs
lorenzhs / gist:e8c1a7d56fa170320eb8
Created August 9, 2014 12:42
Da Glowing Bear test Gist
Dis is a Gist to test embedding in da Glowing Bear.
diff --git a/css/themes/light.css b/css/themes/light.css
index 3460f6a..833e30d 100644
--- a/css/themes/light.css
+++ b/css/themes/light.css
@@ -4,7 +4,7 @@ body {
}
#bufferlines {
- background-color: #efefef;
+ background-color: #f5f5f5;
@lorenzhs
lorenzhs / texmin.sh
Created March 4, 2015 11:50
LaTeX newcommand minimizer
#!/bin/sh
#
# by Lorenz Hübschle-Schneider and Jori Mäntysalo, 2013-2015
# license: cc-by-sa 3.0
# Based on http://tex.stackexchange.com/a/113156
#
# Remove any unnecessary \newcommand and \renewcommand from a LaTeX file
# and ensure that it still compiles
> notneeded
(function(){
var a = navigator.userAgent||navigator.vendor||window.opera;
if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)
||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja
@lorenzhs
lorenzhs / 20-thinkpad-keyboard.conf
Created August 18, 2015 15:18
X11 ThinkPad USB Keyboard config with right click scroll
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|ThinkPad Compact USB Keyboard with TrackPoint|USB Trackpoint pointing device"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "3"
Option "EmulateWheelTimeout" "150"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"