Skip to content

Instantly share code, notes, and snippets.

View ianbattersby's full-sized avatar
🐘
@ianbattersby@hachyderm.io

Ian Battersby ianbattersby

🐘
@ianbattersby@hachyderm.io
View GitHub Profile
public class MainEntryPointClass : BaseClass
{
public IFileLogger FileLogger { get; set; } // For property injection for TDD or (e.g.) AutoFac
public ILogic Logic { get; set; }
public SetupProperties()
{
this.ConfigProperties.Add(typeof(string), "DirectoryPath", "C:\\");
}
@ianbattersby
ianbattersby / gist:3056291
Created July 5, 2012 20:42
ServiceStackReSTExample: Trying to figure out 300 Multiple Choices return
namespace ServiceStackReSTExample
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Net;
using System.Runtime.Serialization;
using System.Threading;
using ServiceStack.Common.Web;
Unhandled Exception: System.MissingMethodException: Method not found: 'System.Web.Helpers.Chart.ExecuteChartAction'.
at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&)
at System.Reflection.MonoMethodInfo.GetMethodInfo (IntPtr handle) [0x00000] in <filename unknown>:0
at System.Reflection.MonoMethod.GetPseudoCustomAttributes () [0x00000] in <filename unknown>:0
at System.MonoCustomAttrs.GetPseudoCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType) [0x00000] in <filename unknown>:0
at System.MonoCustomAttrs.IsDefined (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0
at System.Reflection.MonoMethod.IsDefined (System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0
at Microsoft.Internal.AttributeServices.IsAttributeDefined[ExportAttribute] (ICustomAttributeProvider attributeProvider, Boolean inherit) [0x00000] in <filename
@ianbattersby
ianbattersby / gist:3230065
Created August 1, 2012 19:47
Mono variance validity issue?
// ContravariantIssue.cs(3,26): error CS1961: The contravariant type parameter `TSomething' must be
// covariantly valid on `ContravariantIssue.In.Mono.Example.IInterface<TSomething>.Something'
namespace ContravariantIssue.In.Mono.Example
{
public interface IInterface<in TSomething>
{
TSomething Something { set; }
}
@ianbattersby
ianbattersby / gist:3256480
Created August 4, 2012 09:56
Example xbuild (working from console) which doesn't work from FAKE
> xbuild ./Sandbox/Sandbox.csproj /t:Build /p:OutputPath="Users/ian/Code/Simple.Web/build" /p:Configuration="Debug" /p:VSToolsPath="/Library/Frameworks/Mono.framework/Libraries/mono/xbuild/Microsoft/VisualStudio/v9.0"
XBuild Engine Version 2.11.2.0
Mono, Version 2.11.2.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.
Build started 04/08/2012 10:54:22.
__________________________________________________
Project "/Users/ian/Code/Simple.Web/Sandbox/Sandbox.csproj" (Build target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
@ianbattersby
ianbattersby / gist:3256638
Created August 4, 2012 10:41
FAKE invalid switch error - even with verbose
FakePath: /Users/ian/Code/FAKE/build/FakeLib.dll
FAKE - F# Make - Version 0.2.0.0
LocalBuild
FAKE Arguments:
"build.fsx"
"target"
"details"
"verbose"
FSI-Path: fsi
@ianbattersby
ianbattersby / gist:3258797
Created August 4, 2012 17:07
Git Araxis merge on *nix
[merge]
tool = araxis
[mergetool "araxis"]
cmd = araxisgitmerge \"$REMOTE\" \"$BASE\" \"$PWD/LOCAL\" \"$PWD/MERGED\"
@ianbattersby
ianbattersby / gist:3260445
Created August 4, 2012 22:58
Mono 2.11 bash redirection for FSC (fsharpc)
#!/bin/sh
EXEC="exec "
if test x$1 = x--debug; then
DEBUG=--debug
shift
fi
if test x$1 = x--gdb; then
shift
@ianbattersby
ianbattersby / gist:3260447
Created August 4, 2012 22:58
Mono 2.11 bash redirection for FSI (fsharpi)
#!/bin/sh
EXEC="exec "
if test x$1 = x--debug; then
DEBUG=--debug
shift
fi
if test x$1 = x--gdb; then
shift
@ianbattersby
ianbattersby / gist:3351676
Created August 14, 2012 18:55
Example of StyleCop exclusion for @NathanGloyn
<Compile Include="LeaveMyStyleCopAlone.cs">
<SubType>Code</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>