Skip to content

Instantly share code, notes, and snippets.

View hensing's full-sized avatar

Henning Dickten hensing

View GitHub Profile
@hensing
hensing / refactor_ical_events.ipynb
Created November 21, 2021 12:38
Refactor BonnOrange Waste Management (Abfuhrpläne) iCalendar Events
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hensing
hensing / boldauthorname.tex
Created October 17, 2016 15:38
Make specific author bold using biblatex
% use boldface for specific author in biblatex bibliography
% http://tex.stackexchange.com/questions/73136/make-specific-author-bold-using-biblatex
%
% usage:
% \input{boldauthorname}
% ...
% \begin{document}
% \boldname{Doe}{John}{J.}
% \printbibliography
% \end{document}
@hensing
hensing / add_filter.py
Created June 9, 2016 11:29
git: configures git to filter / clear the output of ipython notebooks
#!/usr/bin/python
# coding: utf-8
"""
configures git to filter / clear the output of ipython notebooks by
patching the .git/config and .gitattributes and adding 'filter_notebook' as filter
"""
import os
import sys
import warnings
import distutils.spawn
@hensing
hensing / get_smartstat
Created March 27, 2015 09:16
FreeBSD: show selected smartctl values for each ada device [freebsd, smartctl, zsh]
#!/usr/bin/env zsh
#
# gets all ada devices and prints selected smartctl values for all devices
#
# by H.Dickten 2015
# get ada devices
ADA=`sudo camcontrol devlist |grep ada| cut -d "(" -f 2 |cut -d ',' -f 1|xargs`
# get array from ada list
@hensing
hensing / .gitattributes
Last active November 13, 2015 12:29
[git/ipynb/nbformat] filter / clear output of ipython notebooks on git commit
*.ipynb filter=filter_notebook
#!/usr/bin/env python
# coding: utf-8
"""
simple notebook to patch/replace XBMC paths in MyVideo.db
infos: [howto @ wiki.xbmc.org](http://wiki.xbmc.org/index.php?title=HOW-TO:Update_SQL_databases_when_files_move)
see also [path substitution](http://wiki.xbmc.org/index.php?title=Path_substitution)
"""
__author__ = 'Henning Dickten'
import sqlite3
@hensing
hensing / python_logging.c
Last active October 15, 2024 14:40
Python: Use 'logging' module from C extension
#include <Python.h>
/***********************************************************/
/* define logging function and logtypes for python.logging */
/* by H.Dickten 2014 */
/***********************************************************/
enum logtypes {info, warning, error, debug};
static void log_msg(int type, char *msg)
{
@hensing
hensing / filter_notebook
Last active June 9, 2016 11:30
simple script for clearing all cells of an ipython notebookUsage: `clear_notebook fname_in.ipynb [fname_out.ipynb]`
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
clears all cells of an ipython notebook
given via stdin or filename
by H.Dickten 2014
"""
import sys
try: