Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Aaronontheweb's full-sized avatar
🚀
Shipping!

Aaron Stannard Aaronontheweb

🚀
Shipping!
View GitHub Profile
@Aaronontheweb
Aaronontheweb / default.js
Created August 21, 2012 08:03
Last-chance exception handling code in WinJS (with MarkedUp)
(function () {
"use strict";
var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;
var nav = WinJS.Navigation;
WinJS.strictProcessing();
app.onerror = function (error) {
//Log the last-chance exception (as a crash)
@Aaronontheweb
Aaronontheweb / ShardExample.cs
Created September 11, 2012 19:22
ShardStrategy.ShardingOn Example - taken from RavenDB.NET docs
//from http://ravendb.net/docs/server/scaling-out/sharding
var shards = new Dictionary<string, IDocumentStore>
{
{"Asia", new DocumentStore {Url = "http://localhost:8080"}},
{"Middle East", new DocumentStore {Url = "http://localhost:8081"}},
{"America", new DocumentStore {Url = "http://localhost:8082"}},
};
var shardStrategy = new ShardStrategy(shards)
.ShardingOn<Company>(company => company.Region)
@Aaronontheweb
Aaronontheweb / BadDefaultShard.cs
Created September 11, 2012 19:31
Sharding Models
var shards = new Dictionary<string, IDocumentStore>
{
{"Shard0", new DocumentStore {Url = "http://localhost:8080"}},
{"Shard1", new DocumentStore {Url = "http://localhost:8081"}},
{"Shard2", new DocumentStore {Url = "http://localhost:8082"}},
};
var shardStrategy = new ShardStrategy(shards)
.ShardingOn<FoodOrder>(order => order.CustomerId);
@Aaronontheweb
Aaronontheweb / app.config
Created September 12, 2012 18:07
MVC4 Assembly Binding Redirect for MVCContrib
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
@Aaronontheweb
Aaronontheweb / CookieTempDataControllerFactory
Created September 21, 2012 22:17
Cookie TempData ControllerFactory
public class CookieTempDataControllerFactory : DefaultControllerFactory
{
public override IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
{
var controller = base.CreateController(requestContext, controllerName);
((Controller)controller).TempDataProvider = new CookieTempDataProvider();
return controller;
}
}
@Aaronontheweb
Aaronontheweb / App.xaml.cs
Created October 17, 2012 19:33
Last-chance exception handling code in WinRT [C#/XAML] using MarkedUp
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
@Aaronontheweb
Aaronontheweb / App.xaml.cs
Created November 6, 2012 00:18
Tracking navigation events in WinRT apps using MarkedUp Analytics (https://markedup.com/)
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
@Aaronontheweb
Aaronontheweb / default.js
Created November 6, 2012 00:27
Tracking navigation events in WinJS apps using MarkedUp Analytics (https://markedup.com/)
(function () {
"use strict";
var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;
var nav = WinJS.Navigation;
WinJS.strictProcessing();
app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
@Aaronontheweb
Aaronontheweb / ActionBenchmarkInvoker-Performance.md
Last active November 14, 2015 00:06
NBench Invoker Performance
BenchmarkDotNet=v0.7.8.0
OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz, ProcessorCount=8
HostCLR=MS.NET 4.0.30319.42000, Arch=32-bit  [AttachedDebugger]
Type=Sdk_ActionBenchmarkInvoker  Method=InvokeRunWithContext  Mode=Throughput  .NET=HostFramework  
Platform Jit AvrTime StdDev op/s
@Aaronontheweb
Aaronontheweb / Akka.Remote.TestKit.partial.csproj
Created November 24, 2015 23:34
Paket .csproj configuration madness
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
<ItemGroup>
<Reference Include="Google.ProtocolBuffers.Serialization">
<HintPath>..\..\..\packages\Google.ProtocolBuffers\lib\net40\Google.ProtocolBuffers.Serialization.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="Google.ProtocolBuffers">
<HintPath>..\..\..\packages\Google.ProtocolBuffers\lib\net40\Google.ProtocolBuffers.dll</HintPath>