Skip to content

Instantly share code, notes, and snippets.

View mguenther's full-sized avatar

Markus Günther mguenther

View GitHub Profile
[user]
email = markus.guenther@gmail.com
name = Markus Günther
[push]
default = matching
# Push created tags from the branch to the server as well
followTags = true
[core]
autocrlf = input
eol = lf
@mguenther
mguenther / option.ts
Created April 13, 2016 14:07
Option<T> monad for TS
export class Option<T> {
_value: T;
constructor(object: T) {
this._value = object;
}
static empty<T>(): Option<any> {
return new Option<T>(null);
@mguenther
mguenther / Fizzbuzz.scala
Created April 7, 2016 09:04
Fizzbuzz tested using PBT approach
package com.mgu.fizzbuzz
object Fizzbuzz extends App {
def fizzbuzz(n: Int): String = n match {
case _ if n % 15 == 0 => "FizzBuzz"
case _ if n % 3 == 0 => "Fizz"
case _ if n % 5 == 0=> "Buzz"
case _ => n.toString
}
@mguenther
mguenther / serve
Created October 17, 2015 23:58
Serve the contents of the current working directory via HTTP
#!/bin/bash
python -m SimpleHTTPServer $1
@mguenther
mguenther / fj.erl
Last active May 10, 2018 08:19
fork/join with parallel quicksort as example (Erlang)
-module(fj).
-export([parallel/2]).
%%%-----------------------------------------------------------------------------
%%% @doc Executes the given function on every task in tasks in parallel.
%%% @spec parallel(Function, Tasks) -> Results
%%% where Results is a list matching the arity of input list Tasks
%%% but contains the result of invoking Function on those tasks
%%% @end