Skip to content

Instantly share code, notes, and snippets.

// POC CQRS bus for stateless synchronous commandhandlers
// and both both syncronous and asynchronous stateless eventhandlers
// Remarks : ToJans@twitter
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading;
@ToJans
ToJans / CQRSAndBDDTogether.cs
Created November 24, 2010 16:49
Another attempt to combine cqrs and BDD
// another attempt to combine CQRS with BDD
// tojans@twitter
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
#region Domain commands
@bmaddy
bmaddy / gist:912632
Created April 10, 2011 19:17
Continuation monad in javascript
function M(){};
M.contResult = function(value){
return function(cont){
console.log('in result: ' + value);
return cont(value);
}
}
M.contBind = function(mValue, mFunc){
@mariusk
mariusk / gist:917391
Created April 13, 2011 11:39
Updated clojure-clr WPF celcius example
; A CLR port of http://bestinclass.wordpress.com/2009/09/24/chaos-theory-vs-clojure/
; Updated to use Rich Hickey's changes: http://paste.lisp.org/display/87799
;
; A WPF app is fired up in another thread. Anything you type in the REPL
; is dispatched to the WPF thread and evaluated there.
;
; Requires the following addition to ClojureCLR's GenDelegate.cs:
; public static Delegate CreateFunc(IFn fn)
; {
; Type delegateType = typeof(Func<>).MakeGenericType(new Type[] { typeof(object) });
@gregoryyoung
gregoryyoung / ProbabilityKata
Created June 10, 2011 09:56
Greg Young's Probability Kata
Value objects are an important concept in DDD. This kata is made both to learn value objects and to learn better ways of testing.
Write a probability value object. It should contain the following methods:
Probability CombinedWith(Probability)
Probability InverseOf()
Probability Either(Probability)
if you forget your probability math:
Either:P(A) + P(B) - P(A)P(B)
CombinedWith: P(A)P(B)
@dauger
dauger / NDC2011ViewingList.tdl
Created June 19, 2011 20:40
List of NDC 2011 videos in ToDoList Format (see www.abstractspoon.com for ToDoList application)
<?xml version="1.0" encoding="windows-1252" ?>
<TODOLIST FILENAME="C:\Projects\Programming\Blog\ND2011 Video Checklist\ND2011.tdl" PROJECTNAME="ND2011" FILEFORMAT="9" NEXTUNIQUEID="166" LASTMODIFIED="2011-06-19" FILEVERSION="111" EARLIESTDUEDATE="0.00000000">
<TASK TITLE="Day 1" ID="1" ICONINDEX="-1" POS="1" PRIORITY="5" RISK="0" PERCENTDONE="0" COST="0.00000000" CALCCOST="0.00000000" STARTDATE="40713.00000000" STARTDATESTRING="2011-06-19" CREATIONDATE="40713.53445602" CREATIONDATESTRING="2011-06-19 12:49 PM" LASTMOD="40713.53452546" LASTMODSTRING="2011-06-19 12:49 PM" PRIORITYCOLOR="15732480" PRIORITYWEBCOLOR="#000FF0">
<TASK TITLE="Keynote - Cloud Computing and Azure" ID="16" ICONINDEX="-1" COMMENTS="Scott Guthrie
http://ndc2011.aventia.no/" POS="1" PRIORITY="5" RISK="0" PERCENTDONE="0" COST="0.00000000" CALCCOST="0.00000000" STARTDATE="40713.00000000" STARTDATESTRING="2011-06-19" CREATIONDATE="40713.54113426" CREATIONDATESTRING="2011-06-19 12:59 PM" LASTMOD="40713.54435185" LASTMODSTRING="2011-06-19 1:03 P
@gregoryyoung
gregoryyoung / Sample.cs
Created July 4, 2011 14:51
Sample Test From Simple.Testing
//This is a sample specification.
public SutSpecification<Depositor> when_withdrawing_money_from_empty_account = new SutSpecification<Depositor>
{
On = () => new Depositor(13),
When = depositor => depositor.Withdraw(50.00m),
Expect =
{
depositor => depositor.Balance > 0.01m,
depositor => depositor.AccountIsOpen
@yevhen
yevhen / SpecificationFixture.cs
Created July 27, 2011 15:26
NUnit support for Greg Young's Simple.Testing "framework"
[TestFixture]
public class SpecificationFixture
{
[Test, TestCaseSource("GetSpecificationTestCases")]
public void Verify(SpecificationToRun spec)
{
var runner = new SpecificationRunner();
RunResult result = runner.RunSpecifciation(spec);
if (result.Passed)
@chrisortman
chrisortman / gist:1123807
Created August 3, 2011 21:25
vim script to remove webforms tags and replace with razor
function! DumpWebforms()
%s/<% \([^}]\)/@\1
%s/<%= /@
%s/<%=/@
%s/<%//
%s/%>//
endfunction
@JamesTryand
JamesTryand / about.md
Created August 10, 2011 18:16 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer