Skip to content

Instantly share code, notes, and snippets.


Rob Moore robdmoore

View GitHub Profile
robdmoore /
Last active Mar 31, 2018
Wordpress -> Jekyll converter

Following you can convert your posts across to Jekyll format, but it adds superfluous metadata and also doesn't correctly handle Wordpress shorttags. This program helps with that.

Fair warning: it's deliberately dirty / hacky code. I ran it with the posts in a Git repo and inspected file-by-file tweaking as I went.

robdmoore / ThreadsafeBddfyTextReporter.cs
Last active Feb 15, 2017
Xunit2 compatible Bddfy output reporter
View ThreadsafeBddfyTextReporter.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using TestStack.BDDfy;
using TestStack.BDDfy.Configuration;
namespace {SomeProject}.Tests.TestHelpers

All public gists in this account are Public Domain unless a separate license is included in the Gist.

robdmoore / setup.sql
Last active Oct 23, 2020
Automated install of SQL Express from commandline
View setup.sql
# If you want to give owner access to the whole server to a particular user account this is how
exec sp_addrolemember 'db_owner', 'NT AUTHORITY\NETWORK SERVICE';
# If you want to idempotently ensure a particular database with name DatabaseName exists this is how
IF NOT db_id('DatabaseName') IS NOT NULL BEGIN
PRINT 'Creating database...'
PRINT 'Created database.'
robdmoore / gist:d2b0fb0ae8f1ff104194
Last active Aug 29, 2015
Install App Insights into Virtual Machine using PowerShell
View gist:d2b0fb0ae8f1ff104194
function Install-AppInsights($instrumentationKey) {
mkdir c:\tempappinsights -Force
pushd c:\tempappinsights
try {
(New-Object Net.WebClient).DownloadFile('',"c:\tempappinsights\")
Expand-ZipFile C:\tempappinsights\ c:\tempappinsights
. C:\tempappinsights\ApplicationInsights.ps1
ApplicationInsightsConfig $instrumentationKey
Start-DscConfiguration -Path C:\tempappinsights\ApplicationInsightsConfig -ComputerName localhost
} finally {
View gist:18ecb3e555b1e40ce978

Keybase proof

I hereby claim:

  • I am robdmoore on github.
  • I am robdmoore ( on keybase.
  • I have a public key whose fingerprint is 7EC9 85C2 A5C2 4121 3EFB 4258 4730 FEAF BA2E 9A78

To claim this, I am signing this object:

robdmoore / gist:44221cc1028ac038931b
Created Dec 15, 2014
Using GitVersion to publish tags to Git repository on various CI servers
View gist:44221cc1028ac038931b


Command Line > Custom Script

"C:\Program Files (x86)\Git\bin\git.exe" tag "%dep.YOUR_CI_BUILD_CONFIG.GitVersion.SemVer%"
"C:\Program Files (x86)\Git\bin\git.exe" push https://%GitUsername%:%GitPassword%@%GitUrl% "%dep.YOUR_CI_BUILD_CONFIG.GitVersion.SemVer%"


Executable > Git Version

robdmoore / forms.showhide.js
Last active Aug 29, 2015
Foolproof validation with show/hide
View forms.showhide.js
$(function() {
$("form").each(function() {
$(this).find("[data-val-requiredif]").each(function() {
var $field = $(this);
var comparisonValue = $"val-requiredif-dependentvalue");
var operator = $"val-requiredif-operator");
var passonnull = $"val-requiredif-passonnull");
var dependentPropertyName = $"val-requiredif-dependentproperty");
var dependentProperties = $("[name=" + dependentPropertyName + "]");
robdmoore / gist:efd01bd380c3c90ef3c3
Created Aug 31, 2014
XDT Transformation to add custom error page URLs to an ASP.NET application.
View gist:efd01bd380c3c90ef3c3
<httpErrors errorMode="Custom" existingResponse="Replace" xdt:Transform="Insert">
<remove statusCode="404" />
<error statusCode="404" path="/error/404" responseMode="ExecuteURL" />
<remove statusCode="500" />
<error statusCode="500" path="/error/500" responseMode="ExecuteURL" />
<remove statusCode="403" />
<error statusCode="403" path="/error/403" responseMode="ExecuteURL" />
robdmoore / gist:f82d74d4c377d4f3755e
Created Aug 31, 2014
List all documents in an Azure DocumentDB Document Collection
View gist:f82d74d4c377d4f3755e
class Program
static void Main(string[] args)
Task.WaitAll(new[] {DoStuff()});
private static async Task DoStuff()
var client = new DocumentClient(new Uri("https://<documentdbtenant>"),