Skip to content

Instantly share code, notes, and snippets.

@ralfw
ralfw / Dockerfile
Created August 18, 2016 06:31
Roll your own Elm Docker container
# Build image with Node.js, Elm and Nginx
FROM debian:latest
# prepare
RUN apt-get -y update
RUN apt-get -y install apt-utils
# install curl, http://stackoverflow.com/questions/27273412/cannot-install-packages-inside-docker-ubuntu-image
RUN apt-get -y install curl
@ralfw
ralfw / game.cs
Last active October 8, 2018 09:10
IODA Architecture for Bowling Game Kata
public class Game {
private int[] rolls = new int[21];
private int currentRoll = 0;
public void roll(int pins) {
rolls[currentRoll++] = pins;
}
public int score() {
var frames = Detect_frames (rolls);
@ralfw
ralfw / ppoop.cs
Last active September 12, 2015 04:45
ppoop solution
using System;
using System.Collections.Generic;
namespace ppoop
{
// source: http://www.csis.pace.edu/~bergin/patterns/ppoop.html
class MainClass
{
public static void Main (string[] args)
@ralfw
ralfw / gist:8b5e796f5012f549b170
Last active August 29, 2015 14:20
Akka Question
using System;
using System.Windows.Forms;
using Akka.Actor;
namespace spike.akka
{
static class Program
{
[STAThread]
static void Main()
@ralfw
ralfw / 01 program.cs
Last active August 29, 2015 14:18
Spellchecker 20150408
namespace spellchecker
{
class MainClass
{
public static void Main (string[] args)
{
var dateipfade = InputReader.Input_Params_lesen (args);
var text = FileIO.Textdatei_lesen (dateipfade.Item1);
var lex = FileIO.Lexikon_lesen (dateipfade.Item2);
@ralfw
ralfw / 01main.groovy
Last active August 29, 2015 14:17
Kata Minesweeper - Ein Versuch mit Groovy
import daten.*
import adapter.*
import domain.*
def (String spielfelddateiname, String mogelzetteldateiname) = CLIadapter.kommandozeilenparameter_lesen(args)
def spielfeldPM = Dateiadapter.lese_Spielfeld(spielfelddateiname)
def mogelzettelPM = berechne_Mogelzettel(spielfeldPM)
Dateiadapter.schreibe_Mogelzettel(mogelzetteldateiname, mogelzettelPM)
def berechne_Mogelzettel(String[] spielfeldPM) {
@ralfw
ralfw / gist:3bfb17d19c081fcf7a7f
Last active August 29, 2015 14:16
CSV Viewer Inkrement #1 - Erste Seite anzeigen
/* CSV Viewer Inkrement #1 - Erste Seite anzeigen */
String[] tabellenzeilen = FirstPage(args)
tabellenzeilen.each {l -> println(l)}
String[] FirstPage(String[] args) {
def dateiname = Dateiname_ermitteln(args)
def seitenlänge = Seitenlänge_ermitteln(args)
@ralfw
ralfw / gist:db45e634e699e1f936e5
Created March 1, 2015 15:10
ToDictionary mit Akka.NET
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading;
using Akka;
using Akka.Actor;
namespace todict
@ralfw
ralfw / hexdump.cs
Created February 19, 2015 12:47
Brownfield Code aus dem Buch "Head First C#". Dank fürs Abtippen und Anpassen an Christian Andritzky.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HexDumper
{
using System.IO;
class Program
@ralfw
ralfw / 01ConsoleServiceProvider.cs
Last active August 29, 2015 14:15
CLI µService Adapters
using System;
using System.Collections.Generic;
using System.Diagnostics;
public class ConsoleServiceProvider : IDisposable
{
private readonly string serviceFilepath;
private readonly string commandlineParams;