Skip to content

Instantly share code, notes, and snippets.

@mowensoft
mowensoft / RestartDocker.ps1
Last active January 2, 2020 14:56
Restart Docker on Windows 10
# Run this from an elevated PowerShell prompt.
# Kill Docker Desktop
Get-Process | Where-Object {$_.ProcessName -match 'Docker Desktop'} | Stop-Process -Force
# Restart the Hyper-V Virtual Machine Management Service
Stop-Service 'vmms'
Start-Service 'vmms'
# Start Docker Desktop
@mowensoft
mowensoft / asciiputsonglasses
Last active October 25, 2017 20:29 — forked from staringispolite/asciiputsonglasses
Ascii art sunglasses meme
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■
@mowensoft
mowensoft / DependencyEx.cs
Created June 14, 2017 14:41
Windsor dependency extension for connection strings
public static class DependencyEx
{
public static Parameter OnConnectionString(string connectionStringName)
{
return OnConnectionString("connectionString", connectionStringName);
}
public static Parameter OnConnectionString(string dependencyName, string connectionStringName)
{
if (string.IsNullOrWhiteSpace(connectionStringName))
namespace NServiceBusXmlSerializerBug
{
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using NServiceBus;
using NServiceBus.MessageMutator;
using NUnit.Framework;
// ReSharper disable InconsistentNaming
@mowensoft
mowensoft / UpdateNuget.ps1
Created May 16, 2016 19:16
Updates NuGet in Visual Studio 2015. Assumes you installed Visual Studio 2015 to the default path.
function IsVisualStudioRunning {
Try {
$visualStudioInstances = (Get-Process devenv)
return ($visualStudioInstances.Length -gt 0)
}
Catch {
return $false
}
}
@mowensoft
mowensoft / BDD.cs
Last active March 24, 2016 14:32
BDD-style specifications using NUnit
using System;
using NUnit.Framework;
namespace Bdd
{
[TestFixture]
public abstract class Specification
{
protected Exception CaughtException = new ThereWasNoExceptionButOneWasExpectedException();
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace EnsureThat
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
Disable-InternetExplorerESC
Disable-UAC
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -DisableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
Set-TaskbarOptions -Size Large -Lock -Dock Bottom
cinst 7zip.install
cinst dropbox
cinst fiddler4