Skip to content

Instantly share code, notes, and snippets.

@dldx
dldx / daemon.py
Created November 6, 2011 16:03
Simple linux daemon module for python
"""Generic linux daemon base class for python 3.x.
Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/"""
import sys, os, time, atexit, signal, errno
class daemon:
"""A generic daemon class.
Usage: subclass the daemon class and override the run() method."""
@dldx
dldx / mpd_notify.py
Created November 6, 2011 16:25
Notifier for MPD using libnotify and cover art
#!/usr/bin/env python
"""Notifies the user when MPD changes
This script polls mpd and sends out a notification using either pynotify or notify-send whenever either the status of
MPD changes or if a new song is being played. In general, it should work fine without any modifications.
Just run it with python mpd-notify.py. If that doesn't work, read on.
Specify the cover art folder, where downloaded cover images will be
stored, below. You can use pycoverart (http://pycoverart.googlecode.com/svn/trunk/cover_art.py) to download cover art
@dldx
dldx / .block
Last active February 3, 2018 15:05
Treemap
border: no
height: 600
license: gpl-3.0
@dldx
dldx / .block
Created May 18, 2018 22:42
fresh block
license: mit
@dldx
dldx / HoC-GE2017-constituency-results.csv
Last active May 31, 2018 14:03
UK 2017 general election results
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 29 columns, instead of 9 in line 5.
ons_id,ons_region_id,constituency_name,county_name,region_name,country_name,constituency_type,declaration_time,result,first_party,second_party,electorate,valid_votes,invalid_votes,majority,con,lab,ld,ukip,green,snp,pc,dup,sf,sdlp,uup,alliance,other,other_winner
W07000049,W92000004,Aberavon,West Glamorgan,Wales,Wales,County,2017-06-09 02:41:00,Lab hold,Lab,Con,49892,33268,57,16761,5901,22662,599,1345,0,0,2761,0,0,0,0,0,0,0
W07000058,W92000004,Aberconwy,Clwyd,Wales,Wales,County,2017-06-09 02:31:00,Con hold,Con,Lab,45251,32150,78,635,14337,13702,941,0,0,0,3170,0,0,0,0,0,0,0
S14000001,S92000003,Aberdeen North,Scotland,Scotland,Scotland,Borough,2017-06-09 02:26:00,SNP hold,SNP,Lab,62130,36757,55,4139,8341,11031,1693,0,0,15170,0,0,0,0,0,0,522,0
S14000002,S92000003,Aberdeen South,Scotland,Scotland,Scotland,Borough,2017-06-09 03:08:00,Con gain from SNP,Con,SNP,64964,44493,63,4752,18746,9143,2610,0,0,13994,0,0,0,0,0,0,0,0
S14000003,S92000003,Airdrie and Shotts,Scotland,Scotland,Scotland,County,2017-06-09 03:10:00,SNP
@dldx
dldx / .block
Last active October 3, 2018 14:24
fresh block
license: mit
@dldx
dldx / munich.md
Last active October 17, 2018 14:17
What to see in Munich in a week

What to see in & around Munich

In Munich

Free walking tour

I've done this tour several times and always enjoyed it. It is a few hours long so wear comfy shoes but they cover a lot of interesting history. It is "free" but you probably should tip them €5-10 at the end. Starts in Marienplatz (which is worth seeing in itself).

Best view in Munich - St. Peter's church tower

@dldx
dldx / .block
Last active November 21, 2018 11:36
World Choropleth
license: MIT
height: 600
border: no
@dldx
dldx / .block
Last active November 30, 2018 16:16
Slope Chart
license: mit
@dldx
dldx / .block
Last active December 9, 2018 23:11
fresh block
license: mit