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; | |
} |
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
private List GetCostAnalysisList() | |
{ | |
var lists = Sharepoint.LoadQuery( | |
Sharepoint.Web.Lists.Where(list => list.Title == "cost-analysis-worksheets")); | |
Sharepoint.ExecuteQuery(); | |
return lists.FirstOrDefault(); | |
} |
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
// j oliver's event store will dispatch commits when you build it up, BEFORE you had a chance to register anything. | |
// So it needs to be lazily evaluated. I don't want to see Lazy<T> in my repo implementation or the application layer. | |
// Don't care if I see it in registration. | |
// this really confusing code allows us to do something like | |
// [Logged] | |
// public void Handle(TestMessage message, IRepository<TestAggregate> repository) {} | |
// | |
// var repository = new Lazy<IRepository<TestAggregate>>(() => new EventStoreRepository(Wireup...Build())); | |
// bus.Register<TestMessage, IRepository<TestAggregate>>(applicationLayer.Handle, () => repository.Value)); |
OlderNewer