This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class RavenDocumentStore | |
{ | |
static RavenDocumentStore() | |
{ | |
using (Create()) | |
{ } | |
} | |
private static Type FindAssemblyLoaderType<T>() | |
{ | |
return (from type in typeof(T).Assembly.GetTypes() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IHttpMessageSerializer | |
{ | |
void Serialize(HttpResponseMessage response, Stream stream); | |
void Serialize(HttpRequestMessage request, Stream stream); | |
HttpResponseMessage DeserializeToResponse(Stream stream); | |
HttpRequestMessage DeserializeToRequest(Stream stream); | |
} | |
public class MessageContentHttpMessageSerializer : IHttpMessageSerializer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<log4net> | |
<appender name="csg-rolling-file" | |
type="log4net.Appender.RollingFileAppender"> | |
<file value="logs/csg-log" /> | |
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> | |
<appendToFile value="true" /> | |
<rollingStyle value="Composite" /> | |
<datePattern value=".yyyyMMdd" /> | |
<maxSizeRollBackups value="10" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
SimpleRunner.RunAllInAssembly(typeof(Program).Assembly).ForEach(PrintSpec); | |
} | |
private static string NicePrint(object target) | |
{ | |
if (target == null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class RavenSingleProjectionSpecification<TViewModel> | |
: QuerySpecification<List<Event>, TViewModel> | |
{ | |
public List<Event> Given = new List<Event>(); | |
public RavenRelativeUri Key; | |
public RavenSingleProjectionSpecification() | |
{ | |
var store = new EmbeddableDocumentStore | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
AppHarbor/CloudAMQP supplies the CloudAMQP RabbitMQ info as a Uri in AppSettings; | |
this adds support for that. | |
most of this code is from the rabbitmq-dotnet-client. | |
*/ | |
public static class RabbitExtensions | |
{ | |
private static string UriDecode(string uri) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class RavenPipelineExtensions | |
{ | |
public static void EnableRaven(this IPipelines pipelines, IDictionary<string, IDocumentStore> documentStores, | |
string ravenSessionKey) | |
{ | |
documentStores.Keys.ForEach( | |
database => | |
{ | |
var key = ravenSessionKey + "." + database; | |
var documentStore = documentStores[database]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CassetteFileAccessConfiguration : IConfiguration<IFileAccessAuthorization> | |
{ | |
#region IConfiguration<IFileAccessAuthorization> Members | |
public void Configure(IFileAccessAuthorization configurable) | |
{ | |
configurable.AllowAccess(path => path.StartsWith("~/content/images")); | |
} | |
#endregion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<configSections> | |
<section name="razor" type="Nancy.ViewEngines.Razor.RazorConfigurationSection, Nancy.ViewEngines.Razor" /> | |
</configSections> | |
<razor disableAutoIncludeModelNamespace="true"> | |
<assemblies> | |
<add assembly="Cassette" /> | |
<add assembly="Cassette.Nancy" /> | |
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> | |
<add assembly="Nancy" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NewRelicAgent = NewRelic.Api.Agent.NewRelic; // protip: don't give class and namespace the same name. it's awkward. | |
public class NewRelicStartup : IStartup | |
{ | |
private readonly IRouteResolver routeResolver; | |
public NewRelicStartup(IRouteResolver routeResolver) | |
{ | |
this.routeResolver = routeResolver; | |
} |