Skip to content

Instantly share code, notes, and snippets.

mjstrasser /
Last active October 15, 2020 05:38
Run Seq with mkcert, NGINX SSL offloading in Docker Compose

What this does

Runs a single-user instance of Seq in Docker with NGINX offloading of a mkcert certificate, listening on port 45341. It also runs the Seq GELF listener in a third container.


mjstrasser /
Last active June 5, 2018 04:13
Utilities for working with Java streams
public class StreamUtils {
* Converts a stream into an iterable for use by, e.g. Spring CrudRepository classes.
"name": "retry-axios",
"version": "1.0.0",
"description": "Retry function for axios promise-based HTTP client",
"scripts": {
"test": "jest --coverage"
"dependencies": {
"is-retry-allowed": "^1.1.0"
mjstrasser / zipper.erl
Created March 19, 2017 01:21
Higher-order functions in practice from Functional Programming in Erlang MOOC
%% Tail-recursive implementation of zip/2
%% that combines items into 2-tuples.
zip(Xs, Ys) -> lists:reverse(zip(Xs, Ys, [])).
% Stop when either list finishes.
zip([], _, Zs) -> Zs;
zip(_, [], Zs) -> Zs;
mjstrasser / index.erl
Created March 13, 2017 04:46
Index generator for week 2 assignment in Functional Programming in Erlang MOOC from University of Kent (
index_file/1, word_index/1]).
%% Index the words in the specified file.
index_file(Filename) ->
mjstrasser /
Last active January 30, 2016 12:46
Keybase proof

Keybase proof

I hereby claim:

  • I am mjstrasser on github.
  • I am mjstrasser ( on keybase.
  • I have a public key whose fingerprint is F541 37DC 4A71 A203 BEE9 F12C A13D 44D8 2E90 4858

To claim this, I am signing this object:

mjstrasser / tunnels.rb
Last active August 29, 2015 14:05
Manage SSH tunnels to remote hosts.
require 'net/ssh/gateway'
module Net
module SSH
# A class that manages URLs, tunnelling them if necessary.
class Tunnels
HP =, :port) do
def to_s
mjstrasser / headers_proxy.rb
Last active August 29, 2015 14:05
Web proxy that injects HTTP headers for test purposes
# Logging class that logs nothing. The default is INFO logging to $stderr.
class NullLog < WEBrick::BasicLog
def log(level, data)
# Do nothing.
# Subclass of WEBrick::HTTPProxyServer that injects HTTP headers into the request.
# Specifying a RequestCallback proc does not work because the WEBrick::HTTPRequest object
mjstrasser / pimp_it_hard.rb
Created July 6, 2014 05:28
Pimp it hard: Ruby script to pummel a number of times, using random colour choice and random delays between messages.
# Run Pimp My Light for a while
require 'httparty'
COLOURS = [:red, :orange, :green]
PML_URL = ''
TOTAL = ARGV.length > 0 ? ARGV[0].to_i : 5
COUNTS = { red: 0, orange: 0, green: 0, except: 0 }