Skip to content

Instantly share code, notes, and snippets.

View TerribleDev's full-sized avatar
🦄
Love Coffee

Tommy Parnell TerribleDev

🦄
Love Coffee
View GitHub Profile
@TerribleDev
TerribleDev / LookupSerializer.cs
Last active April 8, 2016 17:50
ILookup serializer for json.net
using System;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
public class LookupSerializer
{
public static LookupSerializer<Key, Value> New<Key, Value>(ILookup<Key,Value> lookup)
{
return new LookupSerializer<Key, Value>();
@TerribleDev
TerribleDev / medOrder.cs
Created April 16, 2016 01:12
medication order creation
var t = new MedicationOrder();
t.Medication = new ResourceReference()
{
Reference = "http://fhirtest.uhn.ca/baseDstu2/Medication/MedicationIdHere",
Display = "medication"
};
@TerribleDev
TerribleDev / Get-LockedOutUser.ps1
Created July 22, 2016 18:38
where am I lockedout from
<#
.SYNOPSIS
Get-LockedOutUser.ps1 returns a list of users who were locked out in Active Directory.
.DESCRIPTION
Get-LockedOutUser.ps1 is an advanced script that returns a list of users who were locked out in Active Directory
by querying the event logs on the PDC emulation in the domain.
.PARAMETER UserName
The userid of the specific user you are looking for lockouts for. The default is all locked out users.

Keybase proof

I hereby claim:

  • I am terribledev on github.
  • I am terribledev (https://keybase.io/terribledev) on keybase.
  • I have a public key whose fingerprint is 0038 46D2 1D97 8194 BF5E D616 1ECB 05E5 739F 3C98

To claim this, I am signing this object:

@TerribleDev
TerribleDev / setup-win10docker.ps1
Last active January 10, 2021 05:52
install hyper-v, containers, and beta docker on windows so you can use windows containers
# allow scripts to run
set-executionpolicy unrestricted -Force
Get-WindowsOptionalFeature -Online | where {$_.FeatureName -like "*Hyper*" -or $_.FeatureName -like "containers" } | Enable-WindowsOptionalFeature -Online -NoRestart
(new-object net.webclient).DownloadFile('https://download.docker.com/win/beta/InstallDocker.msi','docker.msi')
Start-Process 'docker.msi' /qn -Wait
@TerribleDev
TerribleDev / setup-docker.ps1
Last active January 5, 2017 11:44
setup docker server 2016
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider
invoke-webrequest https://go.microsoft.com/fwlink/?LinkID=836281 -OutFile core.exe
Start-Process 'core.exe' '/install /quiet /norestart' -Wait
@TerribleDev
TerribleDev / Program.cs
Last active January 13, 2019 20:57
parsing args in dotnet core
public static void Main(string[] args)
{
var app = new Microsoft.Extensions.CommandLineUtils.CommandLineApplication();
var catapult = app.Command("catapult", config => {
config.OnExecute(()=>{
config.ShowHelp(); //show help for catapult
return 1; //return error since we didn't do anything
});
config.HelpOption("-? | -h | --help"); //show help on --help
});
@TerribleDev
TerribleDev / setup-docker-win7.ps1
Last active January 19, 2017 11:17
setup docker on older windows machines
# allow scripts to run
set-executionpolicy unrestricted -Force
# install chocolatey
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# install virtualbox docker, docker-machine, docker-compose
choco install -y virtualbox docker docker-machine docker-compose
#!/bin/bash
curl -sSL https://get.docker.com/ | sh
curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
@TerribleDev
TerribleDev / setup-docker-win8-server2012.ps1
Last active January 19, 2017 11:17
setup win8/server2012 with docker-machine
set-executionpolicy unrestricted -Force
dism /Online /Enable-Feature:Microsoft-Hyper-V /All
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y docker docker-machine docker-compose