Skip to content

Instantly share code, notes, and snippets.

View drmohundro's full-sized avatar

David Mohundro drmohundro

View GitHub Profile
drmohundro / FluentTypeGenerator.cs
Created February 19, 2021 01:27
FluentTypeGenerator - Old POC I did for a fluent type generator class
View FluentTypeGenerator.cs
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Web;
using Omitted.Utilities.SystemTypeExtensions;
namespace Omitted.Services.Forms.Core.Clients.Generation
drmohundro / stackoverflow-question.swift
Last active August 24, 2020 16:36
StackOverflow Question - SWXMLHash Test
View stackoverflow-question.swift
import SWXMLHash
let xml = """
drmohundro / pipelines.ps1
Created May 26, 2020 22:10
Get sqlcmd.exe in Azure Pipelines
View pipelines.ps1
$ErrorActionPreference = 'Stop';
Invoke-WebRequest '' -OutFile
try {
Add-Type -AssemblyName System.IO.Compression.FileSystem
} catch { };
[System.IO.Compression.ZipFile]::ExtractToDirectory('./', './')
drmohundro / example.swift
Last active March 9, 2018 02:47
Linux namespace and SWXMLHash
View example.swift
let podcastURL = URL(string: "")!
let contents = """
<rss xmlns:dc="" xmlns:itunes="" xmlns:media="" version="2.0" xml:base="">
<title>Some Title</title>
<description>some awesome feed.</description>
<copyright>Copyright 1995-3001</copyright>
<itunes:author>John Doe</itunes:author>
drmohundro /
Created December 16, 2017 17:34
GhostScript PDF to text stdout
# requires ghostscript to be installed first - on mac, install with `brew install ghostscript`
# -sDEVICE=txtwrite - text writer
# -sOutputFile=- - use stdout instead of a file
# -q - quiet - prevent writing normal messages to output
# -dNOPAUSE - disable prompt and pause at end of each page
# -dBATCH - indicates batch operation so exits at end of processing
gs -sDEVICE=txtwrite -sOutputFile=- -q -dNOPAUSE -dBATCH to-be-processed.pdf
drmohundro /
Created October 14, 2017 03:42

Keybase proof

I hereby claim:

  • I am drmohundro on github.
  • I am drmohundro ( on keybase.
  • I have a public key ASDfnjmOHn27rh_MABD4tr3t-bugI4x2mzGyBU82z3pxzgo

To claim this, I am signing this object:

drmohundro / for-each-db-example.sql
Created January 4, 2017 02:03
T-SQL sp_msforeachdb example
View for-each-db-example.sql
EXEC sp_msforeachdb '
if ''?'' LIKE ''CMS[_]%'' begin
print ''?'';
use [?]
select setting as TransactionGateway, ''?'' as [Database]
from dbo.Setting with(nolock)
where Id = ''TransactionGateway''
drmohundro / has-more-than-one-example.sql
Created January 4, 2017 01:59
T-SQL Has More Than CTE Example
View has-more-than-one-example.sql
; WITH ForImport AS (
,vd.account AS CreditCardOrAch
,vd.account_expiration AS Expires
,vd.routing AS Routing
,vd.address1 AS Address1
,vd.address2 AS Address2
, AS City
drmohundro / backup-example.sql
Last active January 4, 2017 01:58
Backup and Restore Database Examples (T-SQL)
View backup-example.sql
BACKUP DATABASE MyDb TO DISK = 'C:\sql-backups\MyDb-20151119.bak' WITH INIT
drmohundro / fix-casing-issues.rb
Created March 11, 2016 21:46
Fix git casing issues across all directories
View fix-casing-issues.rb
# can just run this in pry
files = `git ls-files | grep Wrongcase`
files.split("\n").each { |file| system("git mv #{file} #{file.gsub('Wrongcase', 'WrongCase')}") }