Skip to content

Instantly share code, notes, and snippets.

@modul
modul / xmonad.hs
Last active October 16, 2019 17:25
XMonad Configuration (WIP)
{-# LANGUAGE RecordWildCards #-}
import XMonad
import XMonad.Config.Kde
import XMonad.Hooks.ManageDocks (avoidStruts)
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.Grid
import XMonad.Layout.NoBorders
import XMonad.Util.EZConfig
import Graphics.X11.Xlib
@modul
modul / .ghci
Last active October 8, 2019 12:37
my GHCI settings
:set -XOverloadedStrings
:set prompt "\ESC[1;34m%s\n\ESC[0;35mλ> \ESC[m"
@modul
modul / jsml.py
Last active September 13, 2019 17:20
Convert JSON to YAML and vice versa (this started http://github.com/modul/cereal)
#!/usr/bin/env python3
#
# Convert files between different serialization formats, i.e.
# YAML to JSON, JSON to YAML, etc.
#
import argparse
import json
import yaml
from os.path import splitext
@modul
modul / .gitconfig
Last active August 22, 2019 13:52
my git config
# This is Git's per-user configuration file.
[include]
path = .gituser
[alias]
ap = add -p
ch = checkout
chb = checkout -b
cho = !git fetch && git checkout
br = branch
brd = branch -d
@modul
modul / .vimrc
Last active July 23, 2019 11:36
my vimrc with Vundle
"
" usual options
"
syntax on
set nocompatible
set ts=4 sts=4 sw=4 sr
set autoindent expandtab
set incsearch nowrap nu modeline autoread
set guioptions=agi
set spelllang=de
@modul
modul / filter.c
Created June 6, 2018 10:53
MSP430 IIR filter routines
/** @file filter.c
*
* IIR filter
*
* Functions to set up and apply second order low-, high- and bandpass filters.
*
* @date 09.02.2016 (created)
* @author giermanr
*/
@modul
modul / spiasync.c
Created June 6, 2018 10:51
MSP430 async SPI driver
/** @file spiasync.c
*
* Non-blocking SPI transfer
*
* @date 08.02.2016
* @author mo@liberejo.de
*/
#include "spiasync.h"
@modul
modul / Binterpret.py
Created March 2, 2018 15:36
Elegant wrapper to convert binary data to named records.
"""
Binterpret
Convert binary data to named records.
Example of a record definition:
>>> inclDef = {
>>> "index": INT,
>>> "left_pitch100": INT,
@modul
modul / printf.c
Created February 27, 2018 15:34
Custom printf implementation
void printf(const char *fmt, ...)
{
#ifdef DEBUG
const char *p;
va_list argp;
int i;
unsigned long j;
long l;
char *s;
struct tm *t;
@modul
modul / version.py
Last active September 22, 2017 13:38
Simple version file generator using git describe. Comes in handy as a pre-build hook.
from subprocess import run, PIPE
from sys import exit, argv
DESCRIBE = ["git", "describe", "--dirty", "--abbrev=4"]
TEMPLATE = """
#ifndef _AUTO_VERSION_H_
#define _AUTO_VERSION_H_
#define VERSION "{tag}"