Skip to content

Instantly share code, notes, and snippets.

View hermanbanken's full-sized avatar
🇳🇱

Herman hermanbanken

🇳🇱
View GitHub Profile
@hermanbanken
hermanbanken / README.md
Last active February 8, 2019 08:11
Multicast

Multicast

Golang channels are not multicast, but it can be done using a sync.Cond & a sync.Mutex. This package defines a MulticastStream which captures events and broadcasts them. It also caches the events so subscribers can replay!

@hermanbanken
hermanbanken / Jest hoist demo.md
Last active December 11, 2018 13:24
Jest hoist demo

Jest hoisting

This repo shows that hoisting (moving jest.mock calls to the top) does not work when you use manual mocks, Jest 21.0 & ts-jest 21.0.

@hermanbanken
hermanbanken / SegmentNumberView.example.png
Last active November 9, 2018 06:45
Swift Playground showing a 7-segment number in a custom UIView #swift #ios #uiview #custom
SegmentNumberView.example.png
@hermanbanken
hermanbanken / Pod ID Randomness.md
Last active November 6, 2018 14:42
Calculating the randomness of Pod IDs

Pods IDs are random

For an A/B testing experiment we needed a random component. The Kubernetes Pod ID is random, but is it random enough? I set out to discover.

First I downloaded a list of Pod ids:

kubectl get pods -o=custom-columns=NAME:.metadata.name --sort-by=.metadata.name > pods.txt

Without Docker

Compare A:

sh make-certs.sh
(nvm use 8.12 && PORT=44330 node server.js) &
(nvm use 8.12 && PORT=44330 node client.js)

with B:

@hermanbanken
hermanbanken / Dockerfile
Last active September 1, 2025 21:47
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@hermanbanken
hermanbanken / .gitignore
Last active February 7, 2018 17:54
AccelStepper, ported from cpp to TypeScript for mraa
node_modules
cpplib
*.js
*.d.ts
@hermanbanken
hermanbanken / .gitignore
Last active January 15, 2018 19:53
Dropbox Folder Size
node_modules
@hermanbanken
hermanbanken / README.md
Last active September 22, 2017 13:51
Veneur.Dockerfile
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0; http://nstrein.example.org/" />
<title>NS Trein</title>
</head>
<body>
If you see this it means that your browser has both JavaScript and meta-refresh disabled.
<script>