Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jamescrowley's full-sized avatar

James Crowley jamescrowley

View GitHub Profile
@PaulStovell
PaulStovell / Group.cs
Created March 31, 2012 11:15
Hierarchies in RavenDB
public class Group
{
public Group()
{
Users = new List<string>();
ChildGroups = new List<string>();
}
public string Id { get; set; }
public string Name { get; set; }
@CoreyKaylor
CoreyKaylor / ModelUrlResolutionCache.cs
Created January 5, 2012 02:36
Transforms InputModel for FubuMVC into the route for asset files, this makes routes refactor friendly and safe from route changes
public class ModelUrlResolutionCache : IModelUrlResolver
{
static Cache<string, string> _inputModelTypeCache;
public ModelUrlResolutionCache(IUrlRegistry urlRegistry, BehaviorGraph graph)
{
if (_inputModelTypeCache == null)
_inputModelTypeCache = new Cache<string, string>(inputModel =>
{
var inputType = Type.GetType(inputModel)
@joliver
joliver / gist:1311195
Created October 25, 2011 03:16
NServiceBusCommitDispatcher
public sealed class NServiceBusCommitDispatcher : IPublishMessages
{
private const string AggregateIdKey = "AggregateId";
private const string CommitVersionKey = "CommitVersion";
private const string EventVersionKey = "EventVersion";
private const string BusPrefixKey = "Bus.";
private readonly IBus bus;
public NServiceBusCommitDispatcher(IBus bus)
{
// Experimental stuff until we get a better picture of how to approach page tree, levels, subpages and such
public class MenuBuilder : IMenuBuilder
{
private readonly IPages _pages;
private readonly IContextualMenu<Page> _pagesMenu;
private readonly Page _currentPage;
public MenuBuilder(IPages pages, IContextualMenu<Page> pagesMenu, Page currentPage)
{
@mattwarren
mattwarren / gist:1214297
Created September 13, 2011 16:53
Faceted search SO example
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using Raven.Abstractions.Data;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Linq;