Skip to content

Instantly share code, notes, and snippets.

View di97mni's full-sized avatar

Martin Nilsson di97mni

View GitHub Profile
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string"
},
"customDomain": {
"type": "string"
},
[NUnitAddin(Type = ExtensionType.Core, Description = "Retries an intermittently failing test.")]
public class RetryTestAddin : IAddin, ITestDecorator
{
public bool Install(IExtensionHost host)
{
var testDecorators = host.GetExtensionPoint("TestDecorators");
if (testDecorators == null) return false;
testDecorators.Install(this);
return true;
}
@di97mni
di97mni / CanSplitIndexes.cs
Created February 20, 2015 15:15
Split RavenDB indexes in different databases
//<?xml version="1.0" encoding="utf-8"?>
//<packages>
// <package id="NodaTime" version="1.3.0" targetFramework="net451" />
// <package id="RavenDB.Bundles.NodaTime" version="3.0.0" targetFramework="net451" />
// <package id="RavenDB.Client" version="3.0.3528" targetFramework="net451" />
// <package id="RavenDB.Client.NodaTime" version="3.0.0" targetFramework="net451" />
// <package id="RavenDB.Database" version="3.0.3528" targetFramework="net451" />
// <package id="RavenDB.Tests.Helpers" version="3.0.3528" targetFramework="net451" />
// <package id="xunit" version="1.9.2" targetFramework="net451" />
//</packages>

Example

Product A

Pricelist 1

1/1 2/1 3/1 4/1 5/1 ...
$100 - $120 $100 $90 ..

Pricelist 2

| 1/1 | 2/1 | 3/1 | 4/1 | 5/1 | ... |

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Indexes;
using Raven.Tests.Helpers;
using Xunit;
namespace Pagination
@di97mni
di97mni / gist:3009467
Created June 28, 2012 06:16
Code example to SO question "Eventstore and Sqlite in-memory"
// This gist is for http://stackoverflow.com/questions/7854446/eventstore-and-sqlite-in-memory/7928744#comment14765049_7928744
// From example http://www.filedropper.com/eventstoredisposedobjectissue
// If Get() is changed from returning IQueryable to IEnumerable and adding commits.ToArray() then it's working
// So from this
public class CommitsController : ApiController
{
private readonly IStoreEvents store;
namespace MTTest
{
public class CustomerRegistrationSaga :
SagaStateMachine<CustomerRegistrationSaga>,
ISaga
{
//Using internal state instead of Combine
private bool isSettingsCreated;
private bool isUserCreated;