Skip to content

Instantly share code, notes, and snippets.

@KlausTrainer
KlausTrainer / vcf_to_23_and_me.py
Created January 27, 2020 22:34
Converts a VCF SNP file from Dante Labs to the 23andme file format.
import re
import vcf
"""
Converts a VCF SNP file from Dante Labs to the 23andme file format.
As the files from Dante Labs don't contain SNP IDs, they are mapped
via variant summary data extracted from dbSNP (see
https://genome.ucsc.edu/cgi-bin/hgTables).
@KlausTrainer
KlausTrainer / pw
Last active September 2, 2016 16:13
#!/bin/sh
PASSWORD_FILE="$HOME/.pw/passwords.gpg"
gpg -d $PASSWORD_FILE | perl -ne "if (/^$1: (.*)$/) { print \$1 }" | xclip -selection clipboard

Design Ops – Design Systems Ops for the rest of us

As many others I have read @kaelig's post Introducing Design Systems Ops with great joy. My head was in danger of falling off from all the nodding and seeing my past years' work reflected in it <3

But there is this one thing that doesn't sit right with me:

who will bridge the gap between the design systems team and the engineering team?

It implies that there is a "design systems team". That might be a thing for very large companies – to quote Jina's presentation on Living Design Systems:

@KlausTrainer
KlausTrainer / os_daemons_test
Created September 28, 2015 10:36
os_daemons_test
==> couch_log (eunit)
Running test function(s):
======================== EUnit ========================
There were no tests to run.
==> couch (eunit)
Running test function(s):
couchdb_os_daemons_tests:os_daemons_test_/0
======================== EUnit ========================
OS Daemons tests
undefined
@KlausTrainer
KlausTrainer / couch_task_status_test
Last active September 28, 2015 10:34
couch_task_status_test
==> couch_log (eunit)
Running test function(s):
======================== EUnit ========================
There were no tests to run.
==> couch (eunit)
Running test function(s):
couch_task_status_tests:couch_task_status_test_/0
======================== EUnit ========================
CouchDB task status updates
couch_task_status_tests:58: should_register_task...ok
diff --git a/test/couch_doc_json_tests.erl b/test/couch_doc_json_tests.erl
index 56587cd..037886f 100644
--- a/test/couch_doc_json_tests.erl
+++ b/test/couch_doc_json_tests.erl
@@ -17,9 +17,10 @@
json_doc_test_() ->
+ TestCtx = test_util:start_couch(),
{
diff --git a/test/couch_doc_json_tests.erl b/test/couch_doc_json_tests.erl
index 56587cd..85a931a 100644
--- a/test/couch_doc_json_tests.erl
+++ b/test/couch_doc_json_tests.erl
@@ -17,9 +17,10 @@
json_doc_test_() ->
+ TestCtx = test_util:start(?MODULE),
{
@KlausTrainer
KlausTrainer / comment.vim
Created November 21, 2014 17:58
functions to comment/uncomment lines
" File: Comment.vim
"
" Purpose: functions to comment/uncomment lines
"
" Author: Ralf Arens <ralf.arens@gmx.de>
"
" Last Modified: 2001-06-06 22:20:23 CEST
" All functions support comment styles, these are:
@KlausTrainer
KlausTrainer / batter-status-watcher.sh
Last active August 29, 2015 14:10
Monitors the remaining battery capacity on a GNU/Linux system, and sends a desktop notification if the remaining capacity falls below a certain threshold.
#!/bin/sh
# Monitors the remaining battery capacity on a GNU/Linux system, and
# sends a desktop notification if the remaining capacity falls below a
# certain threshold.
WARNING_THRESHOLD=7 # percent
ICON="/usr/share/icons/gnome/scalable/status/battery-low-symbolic.svg"
@KlausTrainer
KlausTrainer / check-password.c
Created November 5, 2014 11:38
Checking System Account Passwords on GNU/Linux
#include <stdlib.h>
#include <string.h>
#include <crypt.h>
#include <shadow.h>
int check_password(const char *plain_password, const char *crypt_password)
{
return strcmp(crypt(plain_password, crypt_password), crypt_password) == 0;