Skip to content

Instantly share code, notes, and snippets.


Stefaan Lippens soxofaan

View GitHub Profile
soxofaan / phantomjs-revealjs-slide-capture.js
Last active Jul 1, 2017
PhantomJS script to capture/render screenshots of the slides of a Reveal.js powered slideshow.
View phantomjs-revealjs-slide-capture.js
* PhantomJS script to capture/render screenshots of the slides of a Reveal.js powered slideshow.
var page = require('webpage').create();
var args = require('system').args;
// Get url to render from command line.
var url;
if (args.length < 2) {
soxofaan / .block
Last active Aug 15, 2017
Four-dimensional hypersphere packing
View .block
license: mit
border: no
soxofaan /
Last active Nov 28, 2017
"Zequals" ruthless rounding: just keep one leading digit.
import math
def zequals(x):
"Zequals" ruthless rounding: just keep one leading digit.
123 -> 100
4567 -> 5000
-0.0345 -> -0.03
soxofaan / pandas-timeindex-secondary-y-issue.ipynb
Last active Dec 13, 2017
View pandas-timeindex-secondary-y-issue.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
import subprocess
import random
import time
import threading
from queue import Queue
import collections
class AsynchronousFileReader(threading.Thread):

Google Apps Script to automatically delete mails with a certain label after a certain time


  1. Think of a deletion scheme and create GMail labels accordingly (e.g. I use labels 'todelete/after1week', 'todelete/after1month' and 'todelete/after3months' here)
  2. set up filters in GMail to flag desired mails with these labels
  3. create a Google Apps Script with this script (adapt function names, labels and day offsets appropriatedly) and set up triggers as desired


soxofaan / .block
Last active Dec 29, 2018
Circle of Fifths with Diatonic Seventh Chords
View .block
license: mit
height: 800
border: no
soxofaan /
Last active Apr 13, 2019
Python (3.6+) context manager that catches signals (e.g. SIGINT, SIGTERM) and exposes that. Allows writing infinite loops that can be exited in a clean way.
import logging
import os
import signal
import time
log = logging.getLogger(__name__)
class SignalCatcher:
soxofaan / index.html
Last active May 14, 2019
d3-plugins sankey cycle support
View index.html
<!DOCTYPE html>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="./sankey.js"></script>
<title>Sankey Diagram</title>
View data07-big-with-cycle.js
'nodes': [
{name: "a"},
{name: "b"},
{name: "c"},
{name: "d"},
{name: "e"},
{name: "f"},
{name: "g"},
You can’t perform that action at this time.