Skip to content

Instantly share code, notes, and snippets.

View jeremydmiller's full-sized avatar

Jeremy D. Miller jeremydmiller

View GitHub Profile
@jeremydmiller
jeremydmiller / gist:8962060
Created February 12, 2014 18:53
FubuTransportation saga concurrency propose
using System;
using System.Runtime.Serialization;
namespace FubuTransportation.Sagas.Concurrency
{
/* NOTES
*
* Add a new interface called IStatefulSaga to make things easier
* Add a new interface called IConcurrencyRule that will throw SagaConcurrencyException to abort the current
* TX and queued up outgoing messages if a concurrency violation is detected.
@jeremydmiller
jeremydmiller / gist:9062665
Last active August 29, 2015 13:56
No default instance specified
No default instance is specified. The current configuration for type StructureMap.Testing.Blogposts.Diagnostics.IDevice is:
=======================================================================================================================================
PluginType Namespace Lifecycle Description Name
---------------------------------------------------------------------------------------------------------------------------------------
IDevice StructureMap.Testing.Blogposts.Diagnostics
Transient StructureMap.Testing.Blogposts.Diagnostics.ADevice
Transient StructureMap.Testing.Blogposts.Diagnostics.BDevice
=================================================================================
@jeremydmiller
jeremydmiller / gist:9062738
Created February 18, 2014 01:18
No configuration at all
StructureMap.StructureMapConfigurationException : No default Instance is registered and cannot be automatically determined for type 'StructureMap.Testing.Blogposts.Diagnostics.IDevice'
There is no configuration specified for StructureMap.Testing.Blogposts.Diagnostics.IDevice
1.) new DeviceUser(*Default of IDevice*)
2.) StructureMap.Testing.Blogposts.Diagnostics.DeviceUser
3.) Instance of StructureMap.Testing.Blogposts.Diagnostics.DeviceUser
4.) new DeviceUserUser(*Default of DeviceUser*)
5.) StructureMap.Testing.Blogposts.Diagnostics.DeviceUserUser
6.) Instance of StructureMap.Testing.Blogposts.Diagnostics.DeviceUserUser
@jeremydmiller
jeremydmiller / gist:9062788
Created February 18, 2014 01:24
Decorator blows up
StructureMap.Building.StructureMapBuildException : Error while building type StructureMap.Testing.Blogposts.Diagnostics.BadDecorator. See the inner exception for details
1.) new BadDecorator(The inner IDevice)
2.) Decorator of type StructureMap.Testing.Blogposts.Diagnostics.BadDecorator
3.) StructureMap.Testing.Blogposts.Diagnostics.ADevice
4.) Instance of StructureMap.Testing.Blogposts.Diagnostics.IDevice (StructureMap.Testing.Blogposts.Diagnostics.ADevice)
5.) new DeviceUser(*Default of IDevice*)
6.) StructureMap.Testing.Blogposts.Diagnostics.DeviceUser
7.) Instance of StructureMap.Testing.Blogposts.Diagnostics.DeviceUser
8.) new DeviceUserUser(*Default of DeviceUser*)
9.) StructureMap.Testing.Blogposts.Diagnostics.DeviceUserUser
@jeremydmiller
jeremydmiller / gist:9063077
Created February 18, 2014 01:52
Container.WhatDoIHave()
==============================================================================================================================================================
PluginType Namespace Lifecycle Description Name
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Func<TResult> System Transient Open Generic Template for Func<> (Default)
--------------------------------------------------------------------------------------------------------------------------------------------------------------
IContainer StructureMap Singleton Object: StructureMap.Container (Default)
----------------------------------------------------------------------
@jeremydmiller
jeremydmiller / gist:9063191
Created February 18, 2014 02:00
AssertConfigurationIsValid() Failure
StructureMap.StructureMapConfigurationException : StructureMap Failures: 1 Build/Configuration Failures and 0 Validation Errors
Profile 'DEFAULT'
-----------------------------------------------------------------------------------------------------
Build Error on Instance 'StructureMap.Testing.Blogposts.Diagnostics.DeviceUserUser'
for PluginType StructureMap.Testing.Blogposts.Diagnostics.DeviceUserUser
No default Instance is registered and cannot be automatically determined for type 'StructureMap.Testing.Blogposts.Diagnostics.IDevice'
There is no configuration specified for StructureMap.Testing.Blogposts.Diagnostics.IDevice
@jeremydmiller
jeremydmiller / gist:9063254
Created February 18, 2014 02:05
The "Build Plan" visualization -- your IoC container can't do *this*!
This is the shallow representation
PluginType: StructureMap.Testing.Blogposts.Diagnostics.DeviceUserUser
Lifecycle: Transient
new DeviceUserUser(DeviceUser)
┗ DeviceUser = **Default**
This is the recursive representation
PluginType: StructureMap.Testing.Blogposts.Diagnostics.DeviceUserUser
Lifecycle: Transient
new DeviceUserUser(DeviceUser)
@jeremydmiller
jeremydmiller / gist:96f676cc2ed653ccc364
Last active August 29, 2015 14:02
Javascript Dialect for Projections in Postgresql
/*
ASSUMPTIONS:
- We want the definition of the projection to be "mobile", meaning that it could be executed
either in a PLV8 function in Postgresql, a Node.js web or console application, or anything that can host JS.
Even the browser I suppose if we ever wanted to do historical "replay" like Josh & I did on our Firefly
project
- I'm assuming that we can make a super lightweight analogue for Browserify inside of the Postgresql database so
we can write all Javascript as Node.js modules
@jeremydmiller
jeremydmiller / gist:716aa056a94f81b5715b
Last active August 29, 2015 14:02
Possible client API for appending events
var client = require('pg-events-client'); // just pretend this is what it is
/*
id is unnecessary if it's a new stream, but obviously required
to append to an existing stream
streamType is quasi necessary just to route events to projections.
We can build an "Options" that allows
you to specify a default streamType if it's undefined
@jeremydmiller
jeremydmiller / gist:907e1deb2553a5ca5b18
Created September 19, 2014 13:57
Container.WhatDoIHave()
=================================================================================================================================================
PluginType Namespace Lifecycle Description Name
-------------------------------------------------------------------------------------------------------------------------------------------------
Func<TResult> System Transient Open Generic Template for Func<> (Default)
-------------------------------------------------------------------------------------------------------------------------------------------------
Func<T, TResult> System Transient Open Generic Template for Func<,> (Default)
-------------------------------------------------------------------------------------------------------------------------------------------------
IC