Skip to content

Instantly share code, notes, and snippets.

Simone Busoli simoneb

Block or report user

Report or block simoneb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
<project name="Hello World" default="build" basedir=".">
<description>The Hello World of build files</description>
<property name="debug" value="true" overwrite="false" />
<target name="build" description="greets you">
<echo message="hey there" />
simoneb / NAnt.exe.config
Created Oct 21, 2013
NAnt configuration file modified to support .NET 4.5
View NAnt.exe.config
<?xml version="1.0"?>
<!-- Leave this alone. Sets up configsectionhandler section -->
<section name="nant" type="NAnt.Core.ConfigurationSection, NAnt.Core" />
<section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
<!-- Used to indicate the location of the cache folder for shadow files -->
<add key="shadowfiles.path" value="%temp%\nunit20\ShadowCopyCache" />
simoneb / monadic-labeling.cs
Last active Dec 15, 2015
Monadically labeling a binary tree
View monadic-labeling.cs
<Query Kind="Program" />
void Main()
var tree = branch(
simoneb / readme
Last active Dec 14, 2015
TypeScript - Sublime Text2 build system configuration
View readme
1 - Copy the file typescript.sublime-build in %appdata%\Sublime Text 2\Packages\User
2 - Edit a .ts file
- CTRL+B will compile to .js and save to the same path as the .ts file
- CTRL+SHIFT+B will compile to .js and create+run an HTML page which embeds the script
simoneb / gist:4997391
Created Feb 20, 2013
Path.GetDirectoryName behavior
View gist:4997391
Console.WriteLine(Path.GetDirectoryName(@"c:\windows\temp")); // c:\windows
Console.WriteLine(Path.GetDirectoryName(@"c:\windows\temp\")); // c:\windows\temp !!!
simoneb / async-lambda-support.cs
Created Jan 20, 2013
Async lambda support in NUnit framework
View async-lambda-support.cs
public async Task AsyncLambaSupport()
// throwing asynchronously
Assert.That(async () => await ThrowAsync(), Throws.TypeOf<InvalidOperationException>());
// returning values asynchronously
Assert.That(async () => await ReturnOneAsync(), Is.EqualTo(1));
// "After" works with async methods too
simoneb / nunit-async-testcase.cs
Last active Dec 11, 2015
An async test case returning Task<int>
View nunit-async-testcase.cs
[TestCase(1, 2, Result = 3)]
public async Task<int> TestAddAsync(int a, int b)
return await SumAsync(a, b);
public async Task<int> SumAsync(int a, int b)
return await Task.FromResult(a) + await Task.FromResult(b);
simoneb / nunit-simple-async-task-test.cs
Created Jan 20, 2013
A simple async test returning Task
View nunit-simple-async-task-test.cs
public async Task OneSimpleTest()
var eightBall = new EightBall();
var answer = await eightBall.ShouldIChangeJob();
Assert.That(answer, Is.True);
simoneb / nunit-simple-test-workaround.cs
Last active Dec 11, 2015
A simple test - workaround for async
View nunit-simple-test-workaround.cs
public void OneSimpleTest()
var eightBall = new EightBall();
Task<bool> answer = eightBall.ShouldIChangeJob();
Assert.That(answer.Result, Is.True);
View nunit-simple-async-test.cs
public async void OneSimpleTest()
var eightBall = new EightBall();
var answer = await eightBall.ShouldIChangeJob();
Assert.That(answer, Is.True);
// why am I still here?
You can’t perform that action at this time.