Skip to content

Instantly share code, notes, and snippets.

@codetojoy
codetojoy / gist:3a2904f8ef9ca46ab20d4460fe5c6516
Created July 28, 2016 00:19
Animals version of C# stuff in Slack thread
using System.IO;
using System;
using System.Collections.Generic;
abstract class Animal {
abstract public Animal Poke();
public Animal Poke(String s) {
Console.WriteLine("TRACER Poked " + s);
return this;
@codetojoy
codetojoy / Alterative.cs
Created July 27, 2016 13:17
Original question from Slack (not idiomatic C#)
// NOT idiomatic C#
// works in http://www.tutorialspoint.com/compile_csharp_online.php
using System.IO;
using System;
using System.Collections.Generic;
enum ConditionalThing { State_A, State_B, State_C };
interface AppropriateReturnType {
AppropriateReturnType process(ConditionalThing state);
@codetojoy
codetojoy / gist:7027625
Created October 17, 2013 16:06
for Avdi Grimm's "Sorting Lines..." post
new File(args[1]).withWriter { def writer ->
new File(args[0]).readLines().sort().each { writer.println(it) }
}