Skip to content

Instantly share code, notes, and snippets.

@iamkoch
iamkoch / BullseyeDragonFruit.cs
Created October 18, 2019 09:26
Bullseye + Dragonfruit
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.CompilerServices;
using System.Xml.Linq;
using static Bullseye.Targets;
using static SimpleExec.Command;
namespace build
@iamkoch
iamkoch / GenerateXbehaveSpecHtmlFromXUnitOutput.ps1
Created March 22, 2018 15:06
This takes XUnit output and generates an HTML file with @tags above it. The trait it looks for it "Story"
param(
$configuration = "Debug"
)
[Void][System.Reflection.Assembly]::LoadWithPartialName("System.xml.linq")
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
Set-Location $ScriptDir
$doc = [System.Xml.Linq.XDocument]::Parse([System.IO.File]::ReadAllText("$ScriptDir/xunit-results-xbehave.xml"))
@iamkoch
iamkoch / ExampleAutoDataSpecimenBuilder.cs
Created March 21, 2018 11:05
Use your autodata attribute like the XBehave Example attribute
public class ExampleAutoDataSpecimenBuilder : ISpecimenBuilder
{
private readonly object[] _data;
public ExampleAutoDataSpecimenBuilder(object[] data)
{
_data = data;
}
public object Create(object request, ISpecimenContext context)
@iamkoch
iamkoch / setup-certbot.sh
Created July 28, 2017 10:52 — forked from fredriks/setup-certbot.sh
Certbot on Amazon Linux
#!/usr/bin/env sh
wget https://dl.eff.org/certbot-auto
chmod +x certbot-auto
unset PYTHON_INSTALL_LAYOUT
pip install virtualenv --upgrade --user
# Remove old installation
rm -rf ~/.local/share/letsencrypt
Given a customer is on the Amazon homepage
And they have a prime membership
When the customer searches for goods
Then a Prime delivery option should be displayed
Given a customer is on the Amazon homepage
And they do not have a prime membership
When the customer searches for goods
Then a Prime delivery option should not be displayed
Given a context
When an action occurs
Then there is an observable outcome
@iamkoch
iamkoch / QueryProcessorInstaller
Last active August 29, 2015 14:21
QueryProcessor without concrete implementation
public class QueryProcessorInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.AddFacility<TypedFactoryFacility>();
container.Register(
Component.For(typeof(IQueryProcessor))
.AsFactory(c => c.SelectedWith(new QueryProcessorFactorySelector()))
.LifestyleTransient());
@iamkoch
iamkoch / fizz.py
Created October 19, 2012 12:46
FizzPython
print ", ".join(["FizzBuzz" if i % 15 == 0 else "Fizz" if i % 5 == 0 else "Buzz" if i % 3 == 0 else str(i) for i in range(15+1)])
@iamkoch
iamkoch / DependencyInjection.cs
Created April 9, 2012 16:41
Register all assemblies in MVC Bin folder for Castle.Windsor DI
using System;
using System.IO;
using System.Reflection;
using System.Web;
using System.Web.Mvc;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Castle.Windsor.Installer;
using WednesdayFootball.Factory;