Skip to content

Instantly share code, notes, and snippets.

@dragan
dragan / CouchDocument.cs
Created January 24, 2011 07:33
Quick gist to show the use of hydrating an entity from a dictionary(i.e. CouchDocument).
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace SineSignal.Ottoman
{
public class CouchDocument : Dictionary<string, object>
{
public const string ID_KEY = "_id";
@dragan
dragan / JSON -> Dictionary
Created March 16, 2011 16:25
A little test case for deserializing a JSON object into a Dictionary<string,object>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using ServiceStack.Text;
namespace ServiceStackTest
{
@dragan
dragan / Ketchup.Node Async
Created March 17, 2011 03:37
A few changes to Node to show async for Jason
using System;
using System.Configuration;
using System.Net;
using System.Net.Sockets;
namespace Ketchup
{
public class Node
{
@dragan
dragan / mope-sh-shell
Created April 22, 2012 20:31
Set environment for shell command
#!/usr/bin/env bash
set -e
[ -n "$MOPE_DEBUG" ] && set -x
# Provide mope completions
if [ "$1" = "--complete" ]; then
echo --unset
echo system
@dragan
dragan / nancy-rake-mono-2-10-8-1
Created April 27, 2012 11:21
Nancy Failing Test under Mono 2.10.8.1
Nancy.Tests.Unit.DefaultNancyBootstrapperFixture.Container_should_ignore_specified_assemblies [FAIL]
Assert.Throws() Failure
Expected: TinyIoC.TinyIoCResolutionException
Actual: System.NullReferenceException: Object reference not set to an instance of an object
Stack Trace:
at Nancy.Tests.Unit.DefaultNancyBootstrapperFixture+<Container_should_ignore_specified_assemblies>c__AnonStorey2.<>m__24 () [0x00000] in <filename unknown>:0
at Xunit.Record.Exception (Xunit.ThrowsDelegateWithReturn code) [0x00000] in <filename unknown>:0
@dragan
dragan / Nancy.ViewEngines.DotLiquid.Tests
Created April 27, 2012 19:50
Nancy.ViewEngines.DotLiquid.Tests
Test assembly: /Users/Dale/Development/OpenSource/Nancy/src/Nancy.ViewEngines.DotLiquid.Tests/bin/MonoRelease/Nancy.ViewEngines.DotLiquid.Tests.dll
Nancy.ViewEngines.DotLiquid.Tests.Functional.PartialRenderingFixture.Should_render_view_with_doublequoted_partial [FAIL]
System.NotImplementedException : This is a DynamicProxy2 error: The interceptor attempted to 'Proceed' for method 'IFileSystem GetFileSystem(Nancy.ViewEngines.ViewEngineStartupContext)' which has no target. When calling method without target there is no implementation to 'proceed' to and it is the responsibility of the interceptor to mimic the implementation (set return value, out arguments etc)
Stack Trace:
at Castle.DynamicProxy.AbstractInvocation.ThrowOnNoTarget () [0x00000] in <filename unknown>:0
at Castle.DynamicProxy.CompositionInvocation.EnsureValidTarget () [0x00000] in <filename unknown>:0
at Castle.Proxies.Invocations.IFileSystemFactory_GetFileSystem.InvokeMethodOnTarget () [0x00000] in <filename unknown>:0
Missing method Microsoft.FSharp.Collections.LazyListModule::|Cons|Nil|<[1]>(LazyList`1<!!0>) in assembly /private/var/folders/r1/kr3jvvwd0zgf7szj3b9wdnf40000gn/T/c1770c45-f694-4f86-8b87-36a591e3fd6c/c1770c45-f694-4f86-8b87-36a591e3fd6c/assembly/shadow/762c326a/59b4cb44_2f98f92e_00000001/FSharp.PowerPack.dll, referenced in assembly /private/var/folders/r1/kr3jvvwd0zgf7szj3b9wdnf40000gn/T/c1770c45-f694-4f86-8b87-36a591e3fd6c/c1770c45-f694-4f86-8b87-36a591e3fd6c/assembly/shadow/94b500b6/bb2df998_2f98f92e_00000001/NDjango.Core40.dll
Nancy.ViewEngines.NDjango.Tests.NDjangoViewEngineFixture.GetCompiledView_should_render_to_stream [FAIL]
System.MissingMethodException : Method not found: 'Microsoft.FSharp.Collections.LazyListModule.|Cons|Nil|'.
Stack Trace:
at NDjango.TemplateManagerProvider.NDjango-Interfaces-IParser-Parse (Microsoft.FSharp.Core.FSharpOption`1 parent, Microsoft.FSharp.Collections.LazyList`1 tokens, IParsingContext context) [0x00000] in <filename unknown>:0
@dragan
dragan / rakefile.rb
Created May 3, 2012 04:56
cross plat dev .net rakefile
# encoding: utf-8
require 'rake/clean'
load "VERSION"
COMPILE_TARGET = ENV['CONFIG'].nil? ? "Debug" : ENV['CONFIG']
CLR_TOOLS_VERSION = "v4.0.30319"
NUGET_PACKAGE_CONFIGS = ["src/Mulder.Cli/packages.config", "src/Mulder.Base/packages.config", "src/Mulder.Features/packages.config", "src/Mulder.Tests/packages.config"]
ARTIFACTS_DIR = "artifacts"
@dragan
dragan / install-nuget.sh
Created May 5, 2012 21:41 — forked from half-ogre/install-nuget.sh
A bash script to install nuget.exe and make it available in bash with a proxy script
#!/usr/bin/env sh
set -e
# Respect PREFIX if set, otherwise default to /usr/local
if [ -z "${PREFIX}" ]; then
PREFIX="/usr/local"
fi
# Respect TMPDIR if set, otherwise default to /tmp
@dragan
dragan / CompilerDSL.cs
Created May 10, 2012 21:04
A simple DSL in C#.
using System;
using System.Collections.Generic;
using System.Text;
using Mono.CSharp;
namespace CompilerDsl
{
class EntryPoint
{