Skip to content

Instantly share code, notes, and snippets.

View seesharper's full-sized avatar
🏠
Working from home

Bernhard Richter seesharper

🏠
Working from home
View GitHub Profile
@seesharper
seesharper / AppStart,cs
Created May 15, 2013 13:43
Use VirtualPathProvider to feed virtual .svc files to WCF
using System.ServiceModel.Activation;
using System.Web.Hosting;
using System.Web.Routing;
namespace WcfService1.App_Code
{
public static class AppStart
{
public static void AppInitialize()
@seesharper
seesharper / Bootstrapper
Created November 28, 2013 20:29
A NancyFx Bootstrapper for LightInject
namespace HelloWorldNancy
{
using System;
using System.Collections.Generic;
using LightInject;
using Nancy;
using Nancy.Bootstrapper;
using Nancy.Diagnostics;
class Program
{
static void Main(string[] args)
{
IBar bar = new Bar();
// Can you guess the output?
bar.Execute("TEST");
}
}
@seesharper
seesharper / LightInject.Xunit
Last active August 29, 2015 14:05
Allows LightInject to be used to inject Xunit theory data.
/*********************************************************************************
The MIT License (MIT)
Copyright (c) 2014 bernhard.richter@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@seesharper
seesharper / Fixie
Last active August 29, 2015 14:14
Fixie
/*********************************************************************************
The MIT License (MIT)
Copyright (c) 2014 bernhard.richter@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
/*********************************************************************************
The MIT License (MIT)
Copyright (c) 2014 bernhard.richter@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@seesharper
seesharper / ImportUsers.csx
Last active August 29, 2015 14:17
A C# script (ScriptCS) used to import users into a Ghost Blog database.
using System.Data.SQLite;
using System.Data;
using System.Text.RegularExpressions;
using Dapper;
// Used http://bcrypthashgenerator.apphb.com/ to generate the bcrypt hash for "Password123"
string passwordHash = @"$2a$10$gAq/R8gZFCimFbRO3DCUHOn9xecwJPeVCQt/NGIjASjSouMFEapXq";
string connectionString = @"Data Source = C:\inetpub\wwwroot\blog\content\data\ghost.db";
@seesharper
seesharper / tasks.json
Last active August 29, 2015 14:23
Enables scriptcs files to be compiled and executed within Visual Studio Code
// A task runner that calls the scriptcs compiler (scriptcs) and
// compiles the current opened file.
{
"version": "0.1.0",
"command": "scriptcs",
// The command is a shell script
"isShellCommand": true,
@seesharper
seesharper / Usage
Last active August 29, 2015 14:23
Migrate MsTest files top Xunit
scriptcs .\migrate.csx -- directoryContainingMsTestFiles
@seesharper
seesharper / LightInject.Akka
Created October 6, 2015 15:03
An AKKA dependency resolver
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Runtime.CompilerServices;
using Akka.Actor;
using Akka.DI.Core;
using LightInject;
namespace LightInject.Akka
{