Skip to content

Instantly share code, notes, and snippets.

View kevinobee's full-sized avatar

Kevin Obee kevinobee

  • Canterbury, UK
  • 04:26 (UTC +01:00)
View GitHub Profile
@Antaris
Antaris / DotNetCoreVersionExtensions.cs
Created August 12, 2016 07:53
An approach to building .NET Core applications with Cake, XUnit and synchronous `project.json` versionining for both local and on Bamboo
namespace Cake.DotNetVersion
{
using System;
using System.Collections.Generic;
using Cake.Core;
using Cake.Core.Annotations;
using Cake.Core.IO;
/// <summary>
/// Contains functionality required to updating project file versions.
@Jaykul
Jaykul / Blog: Installing Docker.md
Last active June 9, 2026 18:28
Docker in PowerShell on Windows 10

Using Docker on Windows 10 (Updated at the end of 2019)

Since I wrote this originally, Docker on Windows has become a first-class supported tool, with a Windows Installer and well-documented installation processes from docker and from Microsoft.

Today, I actually install docker using boxstarter scripts where I can Enable-WindowsOptionalFeature -Online -FeatureName containers -All and then choco upgrade -y docker-desktop as well as installing tooling for VS Code code --install-extension "ms-azuretools.vscode-docker".

I've left the rest of these notes here as a historical record, more than anything else. You should not expect the script below to work, but you certainly don

using System.Collections.Generic;
using System.Web.Http.Description;
using Swashbuckle.Swagger;
namespace BoundedContext.Web.Swagger
{
public class LowercaseDocumentFilter : IDocumentFilter
{
public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, IApiExplorer apiExplorer)
{
public class MediatorPipeline<TRequest, TResponse>
: IRequestHandler<TRequest, TResponse>
where TRequest : IRequest<TResponse>
{
private readonly IRequestHandler<TRequest, TResponse> _inner;
private readonly IEnumearble<IMessageValidator<TRequest>> _validators;
private readonly IMessageAuthorizer _authorizer;
public MediatorPipeline(IRequestHandler<TRequest, TResponse> inner,
IEnumerable<IMessageValidator<TRequest>> validator,
@bevand
bevand / ps-download-all-nuget-packages
Last active April 8, 2025 17:25
Powershell script to download all packages from a nuget feed
$destinationDirectory = "C:\LocalNuGetTest\"
$webClient = New-Object System.Net.WebClient
$webClient.Credentials = New-Object System.Net.NetworkCredential("USERNAME", "PASSWORD")
$feed =[xml]$webClient.DownloadString("https://hostednugetfeed.com/custom-feed/nuget/v2/Packages")
$records = $feed | select -ExpandProperty feed | select -ExpandProperty entry #| select -ExpandProperty content
for ($i=0; $i -lt $records.Length; $i++) {
$content = $records[$i] | select -ExpandProperty content
$properties = $records[$i] | select -ExpandProperty properties
@blowdart
blowdart / UpdateIISExpressSSLForChome.ps1
Last active April 26, 2026 23:29
IIS Express certs (for now) don't contain SAN strings. This makes Chrome unhappy. Make Chrome happy again with a new organic, artisanal, gluten free HTTPS certificate.
# Create a new self signed HTTPS Certificate for IIS Express
# Crafted with all organic, GMO, gluten free ingreditations
# with an artisinal SAN to make Chrome 58 onwards happy.
#
# See https://bugs.chromium.org/p/chromium/issues/detail?id=308330
#
# Run this at an administrative PowerShell prompt.
#
# You will be prompted to trust a new certificate via a windows dialog.
# Click yes otherwise Visual Studio will not be able to determine your
@kamsar
kamsar / anexample.ps1
Last active October 18, 2023 14:27
Generate trusted local SSL cert for Solr
# Usage:
# This script is designed to be run after you have Solr running locally without SSL
# It will generate a trusted, self-signed certificate for LOCAL DEV (this must be modified for production)
# Notes: The keystore must be under server/etc on Solr root, and MUST be named solr-ssl.keystore.jks
# The cert will be added to locally trusted certs, so no security warnings in browsers
# You must still reconfigure Solr to use the keystore and restart it after running this script
#
# THIS SCRIPT REQUIRES WINDOWS 10 (for the SSL trust); without 10 remove the lines around trusting the cert.
@hanssens
hanssens / LowercaseDocumentFilter.cs
Last active February 16, 2018 15:26 — forked from rafalkasa/LowercaseDocumentFilter.cs
Updated to exclude parameters from being lowercased (thanks to @jonorogers)
using System.Collections.Generic;
using System.Linq;
using Swashbuckle.AspNetCore.Swagger;
using Swashbuckle.AspNetCore.SwaggerGen;
namespace Heartwork.Api.Application.Filters
{
public class LowercaseDocumentFilter : IDocumentFilter
{
public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context)
@davidfowl
davidfowl / Global.asax.cs
Last active December 4, 2025 20:12
ASP.NET MVC and ServiceCollection sample
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Microsoft.Extensions.DependencyInjection;
using WebApplication16;
using WebApplication16.Controllers;
@derblub
derblub / md-renderer.conf
Created February 11, 2019 19:15 — forked from max-lt/md-renderer.conf
Nginx config to render markdown files (client side)
location /__special {
internal;
allow all;
root /usr/share/nginx/html/__special;
}
location = /__md_file {
internal;
allow all;