Skip to content

Instantly share code, notes, and snippets.


Cees Timmerman CTimmerman

View GitHub Profile

In 2016, Organic Electronics reported 1.3 microns (about 1/100th the width of a human hair) being on par with glass cells, efficiency-wise. I think organic (carbon-based) material degrades faster, though. I guess it's several spray-on coats, bottom up:

  1. Insulating layer.
  2. Positive (p-type) layer with connections. Boron has vacant electron spaces.
  3. Negative (n-type) layer with connections. Solar radiation excites the electrons in the neutral part of the p-type layer enough to move to the n-type layer and via the connection back to the p-type layer, according to ACS. Seems to me putting the part to be exited first in the path of the photons would be better, but more electrons would soak up more photons.
  4. Insulating layer.

Excess potential between the connections could be used to [split water into ox

CTimmerman /
Last active Mar 25, 2021
Convert floats to any base and back.
"""Converts floats to/from any base.
2021-03-25 v1.1 by Cees Timmerman"""
import math
def numeral(i):
gunicorn run:app --workers=9
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker

Macbook Pro 2015 Python 3.7

Framework Server Req/s Max latency +/- Stdev
CTimmerman /
Last active Apr 13, 2021
Windows sucks, too.
echo -e '"$RANDOM returns a pseudorandom integer between 0 and 32767" - False.'
(( r = 1 ))
until ((r <= 0 || r >= 32767))
(( r = $RANDOM ))
echo -e "$r.\nSemicolons replace newlines:"
(( r = 5)); while ((r < 10)); do echo $r; (( r ++ )); done
echo "Ranges include end:"
CTimmerman /
Created Jan 18, 2021 — forked from ohsqueezy/
Play a 440 Hz tone in Pygame
# Generate a 440 Hz square waveform in Pygame by building an array of samples and play
# it for 5 seconds. Change the hard-coded 440 to another value to generate a different
# pitch.
# Run with the following command:
# python
from array import array
from time import sleep
CTimmerman / Jenkinsfile.groovy
Created Dec 15, 2020 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
CTimmerman /
Last active Mar 22, 2021
Tech fails

I have bad experiences with:


  • Dell Latitude 5501 sounds even worse than my MSI MS-16P7 due to ratting its plastic case. Interviews sound like a poor phone connection. Can I Play With Madness on the other hand is tolerable and even has some bass, almost enough for Angels, which sounds like a not-quite-tuned FM radio for the vocals, particularly noticable on Discotheque. Without "audio enhancements" disabled, its audio jack adds a rumble to videos like this. Worst audio hardware I've ever used, especially playing this.
  • HP
    • EliteBook 850 audio jack fail, possibly due to Apple headset with its abberant standard.
    • 2nd EliteBook 850 audio crackle while speaker set to 24 bit.
    • 3rd HP laptop had crackling audio with hardware acceleration.
  • Jay Sound guitar t
CTimmerman /
Created Nov 24, 2020
Simple debugging HTTP server
#coding: utf8
""" Simple debugging HTTP server
2020-11-20 v1.0 by Cees Timmerman
import logging
from pprint import pformat as pf
from flask import Flask, request, make_response
app = Flask(__name__)
CTimmerman /
Created Nov 24, 2020
Euler's pentagonal formula
"""Euler's pentagonal formula, by Cees Timmerman, 2020-11-23."""
import math
def get_lookback_index(x: int):
i = 0
a = 0
b = 1
steps = [1]
while i < x-1: