Skip to content

Instantly share code, notes, and snippets.

Michael Strasser mjstrasser

  • Brisbane, Australia
Block or report user

Report or block mjstrasser

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mjstrasser /
Last active Jun 5, 2018
Utilities for working with Java streams
public class StreamUtils {
* Converts a stream into an iterable for use by, e.g. Spring CrudRepository classes.
View package.json
"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 Mar 19, 2017
Higher-order functions in practice from Functional Programming in Erlang MOOC
View zipper.erl
%% 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 Mar 13, 2017
Index generator for week 2 assignment in Functional Programming in Erlang MOOC from University of Kent (
View index.erl
index_file/1, word_index/1]).
%% Index the words in the specified file.
index_file(Filename) ->
mjstrasser /
Last active Jan 30, 2016
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 Aug 29, 2015
Manage SSH tunnels to remote hosts.
View tunnels.rb
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 Aug 29, 2015
Web proxy that injects HTTP headers for test purposes
View headers_proxy.rb
# 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 Jul 6, 2014
Pimp it hard: Ruby script to pummel a number of times, using random colour choice and random delays between messages.
View pimp_it_hard.rb
# 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 }
You can’t perform that action at this time.