Skip to content

Instantly share code, notes, and snippets.

@leiflm
leiflm / GPIO.py
Created November 5, 2019 20:45
Rudimentary Rpi.GPIO drop-in replacement code to set GPIO `direction` and `value`
class GPIO:
OUT='out'
IN='in'
BOARD=None
@staticmethod
def cleanup():
pass
@staticmethod
@leiflm
leiflm / exclude.fish
Created December 20, 2018 10:11
simple fish function to execute command while ignoring a certain file pattern.
# Defined in - @ line 0
function exclude --description 'fd -j 1 -d 1 -E EXCLUDE_PATTERN -x COMMAND \{\};'
# -j 1 parameter to avoid competing access (i.e. `exclude '*.o' git add`)
# -d 1 limits file/directory retrival to current directory
fd -j 1 -d 1 -E "$argv[1]" -x $argv[2..-1] \{\};
end
@leiflm
leiflm / usr share X11 xkb symbols us_de
Created March 24, 2017 11:15
us de umlauts layout xorg
partial default alphanumeric_keys
xkb_symbols "basic" {
include "us"
include "us_de_diff"
name[Group1]="en_US";
key <RALT> { type[Group1]="TWO_LEVEL",
[ ISO_Level3_Shift, Multi_key ] };
modifier_map Mod5 { <RALT> };
};
xkb_symbols "nodeadkeys" {
#include <stdio.h>
const char *colors[] = {
"2b303b",
"343d46",
"4f5b66",
"65737e",
"a7adba",
"c0c5ce",
"dfe1e8",
keycode 108 = Mode_switch
keysym e = e E dead_acute dead_grave
keysym c = c C ccedilla Ccedilla
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym i = i I idiaeresis Idiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
keysym 3 = 3 numbersign EuroSign
keysym 6 = 6 asciicircum dead_acute dead_circumflex
@leiflm
leiflm / gist:75829bbda3bcc1b538af
Created June 30, 2015 13:27
Search dictionary for words matching a telephone number sequence. Use the 7z'ed .dic from http://sourceforge.net/projects/germandict/
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import codecs
import re
import sys
translation_map = {}
translation_map['a'] = 2
translation_map['A'] = 2
translation_map['ä'] = 2
This file has been truncated, but you can view the full file.
From ed805b3e51a368211e22b69c8e1e9de6303072ec Mon Sep 17 00:00:00 2001
From: Leif Middelschulte <leif.middelschulte@gmail.com>
Date: Tue, 12 May 2015 15:43:39 +0200
Subject: [PATCH] Patch in gliss2 deps, instead of assuming them somewhere
---
gliss2/gep/gep | Bin 0 -> 3459359 bytes
gliss2/gep/gliss-disasm | Bin 0 -> 3108788 bytes
gliss2/gep/gliss-nmp2nml.pl | 462 ++++++++++++++++++++++++++++++++++++++++++++
gliss2/irg/mkirg | Bin 0 -> 2584200 bytes
@leiflm
leiflm / not89.patch
Created October 24, 2013 16:01
Patch for Homebrew Flac Mac OS 10.9 (Maverick)
diff --git a/configure.ac b/configure.ac
index 50ef80e..bdc770b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -388,7 +388,11 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
fi
if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then
- XIPH_ADD_CFLAGS([-fgnu89-inline])
+ if $CC --version 2>&1| grep -q clang ; then