Skip to content

Instantly share code, notes, and snippets.

public class BrilliantLogger
{
...
Dictionary<string,string> _selectedCategories;
...
public void Log(string message, string logCategory)
{
@andlju
andlju / gist:1047909
Created June 26, 2011 19:47
Sample test from coming Entile drop.
public class When_Updating_Registration_On_Registered_Client : With<Client>
{
protected override IEnumerable<IEvent> Given()
{
yield return new ClientRegisteredEvent("1234", "http://my.channel.com");
}
protected override void When(Client client)
{
client.UpdateRegistration("http://new.channel.com");
@andlju
andlju / .gitignore
Created September 5, 2011 20:04
A .gitignore file for VS with ReSharper
# Output directories #
######################
[bB]in
[dD]ebug
[rR]elease
[oO]bj
[bB]uild[aA]rtifacts
# Data #
########
@andlju
andlju / Sample request.txt
Created November 17, 2011 21:04
Sample that shows how to bind by type in Nancy
POST http://localhost:2835/BindByType/FirstType
Content-Type: application/json
Content-Length: 49
{
"Prop1":"Testing",
"Prop2":"Second Test"
}
-----
@andlju
andlju / gist:1405587
Created November 29, 2011 17:19
NServiceBus won't serialize this properly
public class MyMessage : IMessage
{
public string OneValue { get; set; }
public PropertyBase[] Properties { get; set; }
}
public class PropertyBase
{
}
@andlju
andlju / TestModule.cs
Created December 30, 2011 18:04
Unicode problem with Nancy 0.9
public class TestModule :NancyModule
{
public TestModule()
{
Get["/failing"] = _ => "åäö";
Get["/working"] = _ =>
{
Response resp = "åäö";
resp.ContentType += "; charset=utf-8";
@andlju
andlju / gist:3527957
Created August 30, 2012 12:55
LinkedIn request (translated from Swedish)
We are working with a company passionate about helping their clients establishing an integrated approach to the organization's information needs and information management to get the optimal use of information.
// Just nu ser mina Command Handlers ut så här:
public class CreateBookingCommandHandler : IHandleMessages<CreateBooking>
{
private readonly IRepository _repository;
public CreateBookingCommandHandler(IRepository repository)
{
_repository = repository;
}
@andlju
andlju / gist:4008629
Created November 3, 2012 20:33
Design-time vs. runtime
<common:LayoutAwarePage
x:Class="Kodkaffe.App.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Kodkaffe.App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:common="using:Kodkaffe.App.Common"
mc:Ignorable="d"
DataContext="{Binding Main, Source={StaticResource Locator}}">
@andlju
andlju / gist:4635070
Created January 25, 2013 15:04
Build failed for MassTransit
Building for .NET 3.5
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18034]
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 2013-01-25 16:00:52.
Project "C:\Users\1910\Documents\GitHub\MassTransit\src\MassTransit.sln" on node 1 (Clean;Build target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".