Skip to content

Instantly share code, notes, and snippets.

@leachdaniel
leachdaniel / ConfigureRunSettings.md
Created May 23, 2019 02:15
MSTest Configure RunSettings

Setting Up an MSTest Project to work with Multiple Configurations

Create Some Run Settings Files

Add a file to the solution called config1.RunSettings. Add Parameter(s) to the file to change the configuration.

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
  <TestRunParameters>
    <Parameter name="config" value="config1" />
  </TestRunParameters>
@leachdaniel
leachdaniel / allhtmltagsinmd.md
Created January 5, 2019 13:38
All Html Tags in MD

<a> Defines a hyperlink'

test content

<abbr> Defines an abbreviation or an acronym'

test content

<acronym> Not supported in HTML5. Use <abbr> instead. Defines an acronym'

@leachdaniel
leachdaniel / .gitconfig
Last active March 24, 2021 13:08
git aliases
[alias]
# command git config --global alias.logo 'log --oneline'
logo = log --oneline
iwdf = diff --ignore-space-change --ignore-all-space --ignore-space-at-eol --ignore-blank-lines
iwd = diff --ignore-space-at-eol -b -w --ignore-blank-lines
# clean up branches based on remote status - powershell version
branch-prune = "!git fetch -p && for b in $(git for-each-ref --format='%(if:equals=[gone])%(upstream:track)%(then)%(refname:short)%(end)' refs/heads); do git branch -d $b; done"
@leachdaniel
leachdaniel / CopyFromDefaultExchangeProgram.cs
Created May 13, 2018 19:56
Determine if you can copy from the default exchange.
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace RabbitMQPOCs
{
class Program
@leachdaniel
leachdaniel / autogenerated-api-0-9-1.cs
Last active April 25, 2018 15:40
autogenerated-api-0-9-1.cs - 55355a64f1e5d15f51c7af36789cc5dc96a28b82
// Autogenerated code. Do not edit.
// This source code is dual-licensed under the Apache License, version
// 2.0, and the Mozilla Public License, version 1.1.
//
// The APL v2.0:
//
//---------------------------------------------------------------------------
// Copyright (c) 2007-2016 Pivotal Software, Inc.
//
@leachdaniel
leachdaniel / SaveTranscript.ps1
Created February 26, 2018 00:10
Save Transcript for Command Block
function SaveTranscript($tempDir, $actionName, $block)
{
$fileName = "$tempDir\Transcripts\$actionName.txt"
try
{
Stop-Transcript | out-null
} catch { }
Start-Transcript -path $fileName -append
try {
@leachdaniel
leachdaniel / UploadReleaseArtifact.ps1
Last active February 25, 2018 22:39
Upload Release Artifact By Tag Name
# Upload Release Artifact By Tag Name
# If the release doesn't exist it is created
# https://developer.github.com/v3/repos/releases/#upload-a-release-asset
$tagName = "test"
$owner = "leachdaniel"
$repo = "TestGitHubApi"
$gitHubBaseUri = "https://api.github.com"
$filePath = "T:\files.zip"
$fileContentType = "application/zip"
$apiToken = $env:GITHUBAPITOKEN
@leachdaniel
leachdaniel / RemoteDomainAuthInCSharp.ps1
Created January 14, 2018 19:39
Query a Remote Domain Controller in C# with Powershell Script
$Assem = (
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.DirectoryServices.dll"
)
$Source = @”
using System.DirectoryServices;
using System;
namespace RemoteDomainAuthenticationTest
{
@leachdaniel
leachdaniel / Program_ManagedMemoryLeak.cs
Created January 14, 2018 19:29
Example Program to Create a Managed Memory Leak
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ManagedMemoryLeak
@leachdaniel
leachdaniel / Program_DynamicallyCallMethodOnAssembly.cs
Created January 14, 2018 16:07
Dynamically Load an Assembly and call a method on it
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace InterfaceCaller
{
class Program