Skip to content

Instantly share code, notes, and snippets.

@andlju
andlju / gist:5929786
Created July 4, 2013 19:28
Set up Redis with Puppet
package { 'redis-server':
ensure => present
}
service { 'redis-server' :
enable => true,
ensure => running,
require => Package['redis-server']
}
@andlju
andlju / With.cs
Created February 25, 2013 14:40
MassTransit Saga testing
public abstract class With<TSaga> where TSaga : SagaStateMachine<TSaga>, ISaga
{
private SagaTest<BusTestScenario, TSaga> _test;
public SagaTest<BusTestScenario, TSaga> Test
{
get { return _test; }
}
protected TSaga CreateSagaInState(Guid correlationId, State state)
@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".
@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}}">
// 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: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.
@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: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 / 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 / .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 #
########