Skip to content

Instantly share code, notes, and snippets.

View aidapsibr's full-sized avatar

AIDA aidapsibr

View GitHub Profile
@aidapsibr
aidapsibr / PesistateRepository.cs
Created January 5, 2016 20:53
Example of building a statemachine from configuration
using System.Data;
using System.Linq;
using System.Runtime.InteropServices;
using Persistate.Repositories;
using Stateless;
using Susanoo;
namespace Persistate.Susanoo
{
public class PersistateRepository
@aidapsibr
aidapsibr / consul
Created April 4, 2016 03:21 — forked from stojg/consul
consul service init script for debian
#!/bin/sh
### BEGIN INIT INFO
# Provides: consul
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Consul service discovery framework
# Description: Healthchecks local services and registers
# them in a central consul database.
get-childitem . -include *.sln -recurse | foreach ($_) { nuget restore $_.FullName -verbosity detailed}
get-childitem . -include *.png -recurse | foreach ($_) { pngout "$_"}
@aidapsibr
aidapsibr / NancyMiddleware.cs
Created May 25, 2016 20:45
NancyMiddleware-With-TCS
namespace Nancy.Owin
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.CompilerServices;
using System.Security.Claims;
wget -O - oduso.com/36s9.sh | bash
/// <summary>
/// Builds the where filter implementation.
/// </summary>
/// <param name="info">The information.</param>
/// <returns>ICommandSingleResultExpression&lt;TFilter, TResult&gt;.</returns>
public IExecutableCommandInfo BuildWhereFilterTransform(IExecutableCommandInfo info)
{
var mappings = info.Parameters
.Join(_processor.CommandResultInfo.RetrieveResultSetMappings(typeof(TResult)).Export(), parameter =>
parameter.SourceColumn, pair => pair.Key,
using Susanoo.Command;
using Susanoo.Processing;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Susanoo.Transforms
{
internal sealed class WhereFilterTransformFactory<TFilter>
{

ConfigService

The purpose of the configuration service is to provide an easy, centralized, and isolated way to access and modify common platform configuration.

API Documentation

Resolution

var endPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 5467);
var parser = new StompParser();
using(var reStompService = new StompService(endPoint, parser))
{
reStompService.Start((middlewareStack) =>
{
middlewareStack.Push(new TerminationMiddleware().Invoke);
middlewareStack.Push(new ProtocolVersionMiddleware().Invoke);
middlewareStack.Push(new SessionMiddleware().Invoke);
import Human;
public class Message
{
private Human you;
private Human me;
/** OKCupid is not imported because