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
@ianbattersby
ianbattersby / gist:980950
Created May 19, 2011 14:59
TFS Subscriber example, need to access WorkItemStore
public EventNotificationStatus ProcessEvent(
TeamFoundationRequestContext requestContext,
NotificationType notificationType,
object notificationEventArgs,
out int statusCode,
out string statusMessage,
out ExceptionPropertyCollection properties
)
{
statusCode = 0;
@ianbattersby
ianbattersby / NUnitAndPublishTemplate.xaml
Created January 4, 2012 11:19
TFS 2010 Build workflow incorporating NUnit runner and publishing back into TFS via NUnitTfs
<Activity mc:Ignorable="sap" x:Class="TfsBuild.Process" this:Process.BuildSettings="[New Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings()]" this:Process.TestSpecs="[New Microsoft.TeamFoundation.Build.Workflow.Activities.TestSpecList(New Microsoft.TeamFoundation.Build.Workflow.Activities.TestAssemblySpec(&quot;**\*test*.dll&quot;))]" this:Process.BuildNumberFormat="[&quot;$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)&quot;]" this:Process.CleanWorkspace="[Microsoft.TeamFoundation.Build.Workflow.Activities.CleanWorkspaceOption.All]" this:Process.RunCodeAnalysis="[Microsoft.TeamFoundation.Build.Workflow.Activities.CodeAnalysisOption.AsConfigured]" this:Process.SourceAndSymbolServerSettings="[New Microsoft.TeamFoundation.Build.Workflow.Activities.SourceAndSymbolServerSettings(True, Nothing)]" this:Process.AgentSettings="[New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .Ta
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