Skip to content

Instantly share code, notes, and snippets.

@hetsch
hetsch / pizza_dough.py
Last active May 29, 2020 06:37
Pizza dough calculator
import collections
from enum import IntEnum
from copy import copy
import click
class EnumChoice(click.Choice):
def __init__(self, enum, case_sensitive=False, use_value=False):
self.enum = enum
@hetsch
hetsch / med_covid.md
Last active March 22, 2020 13:20
Medikamente Covid19

Schlecht

  • kein Hollertee
  • kein Honig
  • kein Aspro
  • kein Ecchinacea

(verstärken die Imunantwort - will man nicht bei Covid19)

  • kein Ibuprofen
@hetsch
hetsch / scapy_test.py
Last active May 14, 2018 08:51
Testing Scapy
from scapy.all import *
class Header(Packet):
name = 'Header'
fields_desc = [
ByteField('cmd', 0),
ByteField('status', 0)
]
@hetsch
hetsch / m2m_update.mjs
Last active November 4, 2017 20:53
M2M update with objectionjs
import Knex from 'knex';
import objection from 'objection';
import Promise from 'bluebird';
import util from 'util';
function initDatabase() {
const knex = Knex({
dialect: 'sqlite3',
connection: {
filename: './test.db' // ':memory:'
@hetsch
hetsch / kodi
Created July 7, 2017 08:41 — forked from shyamjos/kodi
kodi upstart script , Start kodi automatically with raspbian boot. Tutorial https://linuxsuperuser.com/install-latest-version-kodi-raspbian-jessie/
#! /bin/sh
### BEGIN INIT INFO
# Provides: kodi
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: XBMC media centre
# Description: Starts the XBMC media centre in standalone mode
### END INIT INFO
@hetsch
hetsch / color_relief.py
Last active September 20, 2016 09:26
Create a color relief by using a lookup table
#!/usr/bin/env python3
from PIL import Image
from osgeo import gdal
gdal.UseExceptions()
import numpy as np
import gc
# ----------------------------------
# COLOR LOOKUP TABLE (gradient color) 256x256 8bit
@hetsch
hetsch / ratemusic.sh
Last active July 20, 2016 07:58
Replay gain processing with bs1770gain
#!/bin/bash
## Usage: rate-music [0-5]
#
# Adds current playing song to the mpd playlist corresponding to the
# rating assigned. Any previous rating is removed. If 0 is given, the
# songs rating will be removed.
#
# From: https://bbs.archlinux.org/viewtopic.php?id=116113
## USER CONFIGURATION-----------------------------------------------------
@hetsch
hetsch / chapter.tex
Created January 2, 2016 13:28
Chapter Formatting
\KOMAoption{chapterprefix}{true}
\renewcommand*\raggedchapter{\centering}
\RedeclareSectionCommand[
beforeskip=0pt,
innerskip=-.3\baselineskip,
%afterskip=8\baselineskip,
font=\Huge\sffamily,
prefixfont=\normalfont\large\scshape
]{chapter}
@hetsch
hetsch / citeproc-js.html
Created August 1, 2015 07:54
Using "author-only" in citeproc
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<link rel="stylesheet" type="text/css" media="screen" href="css/master.css" />
<script type="text/javascript" src="jquery.min.js"></script>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->