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 ClaimsModuleSpecifications | |
{ | |
public Specification list_of_existing_claims() | |
{ | |
return new ModuleSpecification<ClaimsModule> | |
{ | |
Bootstrap = bootstrapper => { }, | |
When = () => UserAgent.Get("/claims"), | |
Expect = | |
{ |
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 CassetteBundleConfiguration : IConfiguration<BundleCollection> | |
{ | |
public void Configure(BundleCollection bundles) | |
{ | |
bundles.Add<StylesheetBundle>("content/bootstrap/metro-bootstrap", new[] {"metro-bootstrap.less"}); | |
bundles.Add<StylesheetBundle>("content/bootstrap", new[] {"bootstrap.less"}); | |
bundles.Add<StylesheetBundle>("content/css/app", new[] {"main.less"}); | |
bundles.AddPerIndividualFile<StylesheetBundle>("content/css/lib", new FileSearch | |
{ |
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 ICheckRequests | |
{ | |
bool IsLocal(); | |
} | |
public class ProductionRequestChecker : ICheckRequests | |
{ | |
public bool IsLocal() | |
{ | |
return HttpContext.Current.Request.IsLocal; |
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
bus.Register(new LoggedAttribute().Apply<SendEmail>(message => | |
{ | |
using (var client = new SmtpClient()) | |
{ | |
client.Send(message); | |
} | |
})); |
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 Item { | |
public ReactiveCommand Remove{ get; protected set; } | |
} | |
public class MyModel { | |
public ObservableCollection<Item> Items { get; protected set; } | |
} | |
MyModel model = new MyModel{Items = { new Item(), new Item() }}; | |
this.Items = model.Items.CreateDerivedCollection(projectFunction); | |
// how to wire existing Item's RemoveIt command here? |
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 Probability : IEquatable<Probability> | |
{ | |
#region Equality members | |
public bool Equals(Probability other) | |
{ | |
return EqualsWithin(other, 5); | |
} | |
public override bool Equals(object obj) |
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)); |
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
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
<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" /> |