Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Ueding martin-ueding

View GitHub Profile
View style.py
[style]
# Align closing bracket with visual indentation.
align_closing_bracket_with_visual_indent=True
# Allow dictionary keys to exist on multiple lines. For example:
#
# x = {
# ('this is the first element of a tuple',
# 'this is the second element of a tuple'):
# value,
@martin-ueding
martin-ueding / scm_prompt.sh
Created May 6, 2020
Version control prompt
View scm_prompt.sh
#!/bin/bash
# Copyright © 2012 Martin Ueding <dev@martin-ueding.de>
# This script has been placed in the public domain via the CC0 license:
# https://creativecommons.org/publicdomain/zero/1.0/
# Checks the current working directory for a git, bzr (or svn or hg, …) tree
# and displays the apropriate name. If the status is supposed to be displayed,
# a ``bzr status`` is run. Git features the ``__git_ps1``, which is used instead in
# case a git repo is found.
View Makefile
# Copyright © 2015 Martin Ueding <mu@martin-ueding.de>
font := /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf
diag := $(wildcard *.diag)
pdf := $(diag:.diag=.pdf)
svg := $(diag:.diag=.svg)
all: $(pdf) $(svg)
View hanoi.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright © 2016 Martin Ueding <mu@martin-ueding.de>
import argparse
stacks = [
[4, 3, 2, 1],
View lightdm-utab.te
module lightdm-utab 1.0;
require {
type unlabeled_t;
type mount_var_run_t;
type home_root_t;
type xdm_t;
class file { append create getattr read write open };
class dir { create write setattr };
}
View tikzpicture_wrap.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright © 2015-2016 Martin Ueding <mu@martin-ueding.de>
# Licensed under The MIT License
import argparse
import jinja2
View unused_boot_entries.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright © 2016 Martin Ueding <mu@martin-ueding.de>
import argparse
import re
import subprocess
PATTERN = re.compile(r'Boot([0-9A-F]{4})\*?\s+([^\t]+)\s(\S+)')
View clock_test.c
// Copyright © 2016 Martin Ueding <mu@martin-ueding.de>
// Test the cost of various time implementations.
#include <mpi.h>
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
View projection.scad
module mycube() {
cube(size = 20, center = true);
};
module myplane(thickness) {
color("black", alpha = 0.1)
rotate([0, 0, 180])
rotate([0, 0, 135])
rotate([-145, 0, 0])
translate([-20, 0, -20])
View compile.sh
#!/bin/bash
# Copyright © 2014, 2016 Martin Ueding <mu@martin-ueding.de>
# Licensed under the MIT license
set -e
set -u
set -x
options="-Wall -Wpedantic -O3 -march=native"