Skip to content

Instantly share code, notes, and snippets.

View dmmusil's full-sized avatar

Dylan Musil dmmusil

  • Red Rover
  • Apex, NC
View GitHub Profile
@dmmusil
dmmusil / EsBankAccount.cs
Created July 26, 2022 00:53 — forked from akhansari/EsBankAccount.cs
C# prototype of Decider pattern. F# version: https://github.com/akhansari/EsBankAccount
namespace EsBankAccount
{
// events
public interface IBankAccountEvent { }
public record Transaction(decimal Amount, DateTime Date);
public record Deposited(Transaction Transaction) : IBankAccountEvent;
public record Withdrawn(Transaction Transaction) : IBankAccountEvent;
public record Closed(DateTime Date) : IBankAccountEvent;
// commands
@dmmusil
dmmusil / SchemaCompare.cs
Last active March 6, 2021 21:36
Using DACFx to schema compare and ignore a set of schemas
private static int SchemaCompare(string scmpPath, string databaseName, string outputPath)
{
var schemaComparison = new SchemaComparison(scmpPath);
var result = schemaComparison.Compare();
if (result.IsEqual)
{
Console.WriteLine("No differences detected.");
return 0;
}

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@dmmusil
dmmusil / MachineKeys.cs
Created November 7, 2020 13:51 — forked from cmcnab/MachineKeys.cs
Extracting current ASP.NET machine keys and setting them without committing them to the Web.config
namespace MyApp.Web.Security
{
using System;
using System.Configuration;
using System.Reflection;
using System.Web;
using System.Web.Configuration;
public class MachineKeys
{
@dmmusil
dmmusil / azure-deployment.ps1
Created October 29, 2020 14:59 — forked from sbarski/azure-deployment.ps1
How to deploy to Azure Cloud Service via Powershell
param([string]$publishSettingsFileLocation, [string]$azureSubscriptionName, [string]$storageAccount, [string]$packagePath, [string]$packageName, [string]$containerName, [string]$serviceName, [string]$configPath, [Int32]$instancePollLimit = 1200, [Int32]$instancePollRate = 60, [string]$removeStagingInstance)
#The old publish settings file - use Get-AzurePublishSettingsFile to https://windows.azure.com/download/publishprofile.aspx to get the file
Write-Host "publishSettingsFileLocation is $publishSettingsFileLocation"
#The azure subscription name related to the account, eg. "Window Azure MSDN - Visual Studio Premium"
Write-Host "azureSubscriptionName is $azureSubscriptionName"
#The storage account where to upload the package. It must exist. E.g. mystorageaccountforupload
Write-Host "storageAccount is $storageAccount"