Skip to content

Instantly share code, notes, and snippets.

View acken's full-sized avatar

Svein Arne Ackenhausen acken

View GitHub Profile
can you edit this??
class Hello {
public void thisIsId() {
}
}
@acken
acken / gist:5825b4cf2c755b27f818
Last active August 29, 2015 14:02
Command string parser
// Takes a "quoted argument string ignoring \" escaped" arguments. Returns an array of arguments
let commandStringToArguments (cmd: string) =
// Checks whether a quote is lead by an escape char
let isUnescapedQuote (i, c) =
c.Equals('"') && (i.Equals(0) || (cmd |> Seq.toArray).[i-1] <> '\\')
// Get the start and end position of quoted strings
let quotedStrings =
cmd
|> Seq.toArray
@acken
acken / gist:c9656c84111fe59f1e98
Last active August 29, 2015 14:02
CQRS pattern thingie
#r "/home/you/src/thisthing/lib/JSONNet/Newtonsoft.Json.dll"
open System
open Newtonsoft.Json
// Identifier type
type Id = System.Guid
module EventStore =
type VersionedEvent = int * string
@acken
acken / gist:9675693
Created March 20, 2014 22:49
OpenIDE reactive script for automatically adding and removing .cs files as they are created/deleted
#!/usr/bin/env python
import os
import sys
import subprocess
def runProcess(exe,workingDir=""):
if workingDir == "":
workingDir = os.getcwd()
subprocess.Popen(exe, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=workingDir)
@acken
acken / gist:8520086
Created January 20, 2014 13:44
Output from rake mono (nancy)
Version: 0.21.1
Main project does not update assembly info
D, [2014-01-20T14:40:52.948831 #27329] DEBUG -- : Executing xBuild: "xbuild" "src/Nancy.sln" /p:configuration="MonoRelease" /p:TargetFrameworkProfile="" /p:TargetFrameworkVersion="v4.0"
XBuild Engine Version 2.10.8.1
Mono, Version 2.10.8.1
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.
Build started 1/20/2014 2:40:53 PM.
__________________________________________________
Project "/home/ack/src/Nancy-0.21.1/src/Nancy.sln" (default target(s)):
@acken
acken / Program.cs
Created October 25, 2013 08:55
ContinuousTests headless engine using the ContinuousTests.ExtensionModel.dll
using System;
using System.Linq;
using ContinuousTests.ExtensionModel;
using ContinuousTests.ExtensionModel.Arguments;
namespace test
{
class Program
{
static void Main(string[] args)
@acken
acken / gist:5442592
Created April 23, 2013 10:46
Sublime vim windows navigation
import sublime, sublime_plugin
class VimWindowNavigateLeftCommand(sublime_plugin.WindowCommand):
def run(self):
next = 0
active = self.window.active_group()
if active > 0:
next = active - 1
@acken
acken / commandments.md
Created November 29, 2011 12:17 — forked from oc/commandments.md
Ashcroft commandments
  1. I am the class being tested. Thou shalt not test any other class but me.
  2. You shall not make for yourself a mock of an API that you don't own.
  3. You shall not call a system or integration test a unit test.
  4. Your unit test suite shall not take all week to run.
  5. [father and mother]
  6. Thou shall not kill the runtime environment.
  7. [adultery]
  8. [steal]
  9. You shall not bear false witness against your neighboring tests.
  10. You shall not covet your system's files, you shall not covet your system's threads, or his sockets, or his graphics environment, or his environment variables, or anything that is part of your system.
@acken
acken / MsgDispatcher.cs
Created October 27, 2011 08:04
Message dispatcher
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace MinimalMessaging
{
public class MessageDispatcher : IMessageDispatcher
{