Skip to content

Instantly share code, notes, and snippets.

View robashton's full-sized avatar
🍻
drinking

His Excellence Sir Professional of Rob upon Ashtonburyshirester robashton

🍻
drinking
View GitHub Profile
@robashton
robashton / Projections with RavenDB
Created November 4, 2010 11:19
Demoing the expected? behaviour with projections + select many
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Raven.Database;
using Raven.Database.Indexing;
using Raven.Client.Indexes;
using Newtonsoft.Json.Linq;
using Raven.Client.Client;
@robashton
robashton / Projections with RavenDB.cs
Created November 4, 2010 11:20
Demonstrating expected? behaviour with projections/ravendb/selectmany
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Raven.Database;
using Raven.Database.Indexing;
using Raven.Client.Indexes;
using Newtonsoft.Json.Linq;
using Raven.Client.Client;
@robashton
robashton / test.cs
Created December 3, 2010 14:27
This is the test
[TestFixture]
public class WhenCreatedTypeHasBaseTypes
{
IGenerationSession mSession;
[SetUp]
public void Setup()
{
mSession = AutoPocoContainer.Configure(x =>
{
@robashton
robashton / example.cs
Created January 4, 2011 15:57
Overriding the data source
mResults = mSession.List<SimpleUser>(5)
.Source(x => x.EmailAddress, new DummySource())
.Get();
var session = AutoPocoContainer.CreateDefaultSession();
var users = session.Collection<SimpleUser>(10, all =>
{
all.Random(5)
.Impose(x => x.FirstName, "Rob")
.Next(5)
.Impose(x => x.FirstName, "Scott");
all.Random(5)
@robashton
robashton / gist:775219
Created January 11, 2011 21:47
My reply
Hmm, that's the first time time a recruiter has ever refused a request for more information.
Honestly I don't know what you can't give me over e-mail that you have to give me over phone - if you're that worried I'll expend the effort required to go searching for the opportunity directly using whatever meager information about the role you guys normally end up giving then you are clearly are not confident in being able to provide enough value to either myself or the company to warrant your role in the affair.
Sure, I'm doing great on finding work, I'll never normally say no to hearing about other opportunities though - I just draw the line at handing my phone number to recruiters/agents before hearing any details, because while I can easily set up Spam rules in my e-mail, I can't do likewise for phone.
TLDR: If you aren't willing to tell me anything about the opportunity over e-mail, then I will indeed continue on my own course
Thanks,
public static IEngineConfigurationTypeBuilder<TPoco> Collection<TPoco, TCollection>(
this IEngineConfigurationTypeMemberBuilder<TPoco, TCollection> memberConfig, int min, int max) where TCollection : IEnumerable
{
var collectionType = typeof (TCollection);
// Nefarious, I know - shocking, this will get is Y from X<Y> where X = IEnumerable/List/Etc and Y = Type
// So List<Y> etc
var genericcollectionArgument = collectionType.GetGenericArguments()[0];
// So this will give us AutoSource<Y>
For<IReportService>()
.AlwaysUnique()
.Singleton()
.Add<ReportService>()
.Named(configuration.Id)
.Ctor<string>("clientId").Is(configuration.Id)
.Ctor<string>("dataServer").Is(configuration.Application.ReportingServer)
.Ctor<string>("databaseName").Is(configuration.Application.ReportingDatabase)
.Ctor<string>("dataUsername").Is(configuration.Application.ReportingUsername)
.Ctor<string>("dataPassword").Is(configuration.Application.ReportingPassword);
@robashton
robashton / Bootstrapper.cs
Created February 7, 2011 18:50
WomRegistry
public static class Bootstrapper
{
public static void Startup()
{
var documentStore = new EmbeddableDocumentStore
{
Configuration = new RavenConfiguration
{
DataDirectory = "App_Data\\RavenDB",
}
@robashton
robashton / ServiceActionCall.cs
Created February 9, 2011 16:58
A botched attempt at injecting a validation step to the behaviour onion
public class ServiceActionCall : ActionCall
{
private readonly ActionCall inner;
public ServiceActionCall(ActionCall inner) : base(inner.HandlerType, inner.Method)
{
this.inner = inner;
}
protected override ObjectDef buildObjectDef()