Skip to content

Instantly share code, notes, and snippets.

@Vidarls
Vidarls / Approvals.cs
Created August 1, 2011 06:07
Provisional extension points to modify namer and reporter at runtime.
public class Approvals
{
//Default implementation works as before
static Func<IApprovalNamer> _defaultNamerSource = (()=> new UnitTestFrameworkNamer());
//Extension point to allow injection of new default namer
//at runtime, as vb6 does not support attributes, nor stacktraces.
public static Func<IApprovalNamer> DefaultNamerSource
{
private get { return _defaultNamerSource; }
@Vidarls
Vidarls / StackTraceParsers.cs
Created August 17, 2011 06:51
Xunit support for approval tests
namespace ApprovalTests.StackTraceParsers
{
public class StackTraceParser : IStackTraceParser
{
private static IStackTraceParser[] parsers;
private IStackTraceParser parser;
public bool Parse(StackTrace stackTrace)
{
@Vidarls
Vidarls / gist:1222865
Created September 16, 2011 19:11 — forked from marcusoftnet/gist:1222823
Base for a repository demo test with Simple.Data.FakeResult
using System;
using System.Collections.Generic;
using FakeItEasy;
using NUnit.Framework;
using Simple.Data.FakeResult;
namespace TestingWithSimpleDataFakeResult
{
[TestFixture]
public class RepositoryUsingSimpleDataTests
@Vidarls
Vidarls / Eventlist.sshtml
Created October 5, 2011 13:33
Super naive nancy stuff
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Events</title>
</head>
<body>
<h1>Events</h1>
<table>
<thead>
<tr>
@Vidarls
Vidarls / buidoutput.txt
Created May 10, 2012 08:14
Simple.Data.Mysql build error
Building: Simple.Data.Mysql (Debug)
Building Solution Simple.Data.Mysql
Building: Simple.Data.Mysql.Mysql40 (Debug)
Performing main compilation...
Compiling resource /home/vidarls/Simple.Data.Mysql/Src/Simple.Data.Mysql.Mysql40/Properties/Resources.resx with /usr/bin/resgen
/usr/bin/dmcs /noconfig "/out:/home/vidarls/Simple.Data.Mysql/Src/Simple.Data.Mysql.Mysql40/bin/Debug/Simple.Data.Mysql.Mysql40.dll" "/r:/home/vidarls/Simple.Data.Mysql/Src/packages/Simple.Data.Core.0.16.1.0/lib/net40/Simple.Data.dll" "/r:/home/vidarls/Simple.Data.Mysql/Src/packages/Simple.Data.Ado.0.16.1.0/lib/net40/Simple.Data.Ado.dll" "/r:/usr/lib/mono/4.0/System.dll" "/r:/usr/lib/mono/4.0/System.ComponentModel.Composition.dll" "/r:/usr/lib/mono/4.0/System.Core.dll" "/r:/usr/lib/mono/4.0/System.Data.dll" "/r:/usr/lib/mono/4.0/System.Xml.Linq.dll" "/r:/usr/lib/mono/4.0/System.Data.DataSetExtensions.dll" "/r:/usr/lib/mono/4.0/Microsoft.CSharp.dll" "/r:/usr/lib/mono/4.0/System.Xml.dll" /nologo /warn:4 /debug:+ /debug:full /optimize- /c
using System.Drawing;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
namespace RayTracer {
public class RayTracer {
@Vidarls
Vidarls / reproduction.cs
Last active August 29, 2015 14:05
Nemq issue
using NetMQ;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace NetMQIssue
{
class Program
{
@Vidarls
Vidarls / Build.fsx
Last active August 29, 2015 14:16
Working first attempt at VB6 build helper for FAKE
//Example use
Target "BuildVb6" (fun _ ->
!! "src/**/*.vbp"
|> Vb6Make (fun c ->
{ c with
Logdir = temp
Outdir = bin })
)
@Vidarls
Vidarls / Extract.fs
Last active August 29, 2015 14:17
Flattening extracting binaries from packages
#r @"packages/FAKE/tools/FakeLib.dll"
open Fake
open System
open System.IO
type FxVersion =
| Net4
| Net35
@Vidarls
Vidarls / SleepyJoe.fsx
Last active August 29, 2015 14:19
Meetup code 16 April 2015
open System
open System.IO
type Period = {Start:DateTime; End:DateTime;}
let data = File.ReadAllLines("maildatoer.txt")
|> List.ofArray
|> List.map (fun timeString -> timeString.Trim('"'))
|> List.map DateTime.Parse
|> List.choose (fun parsedTime ->