Skip to content

Instantly share code, notes, and snippets.

View tjrobinson's full-sized avatar

Tom Robinson tjrobinson

View GitHub Profile
@tjrobinson
tjrobinson / AutoMocker.cs
Created March 20, 2021 17:50
AutoMocker experiments
// @nuget: Moq.AutoMock -Version 2.3.0
using System;
using Moq;
using Moq.AutoMock;
public interface IMyService
{
string GetValue();
}
@tjrobinson
tjrobinson / keybase.md
Created September 11, 2019 10:37
Keybase proof

Keybase proof

I hereby claim:

  • I am tjrobinson on github.
  • I am tjrobinson (https://keybase.io/tjrobinson) on keybase.
  • I have a public key ASCdJ2JCJnqEf8zJZNdzNMrDgIlwjDMoviRhipP0YE0NuQo

To claim this, I am signing this object:

@tjrobinson
tjrobinson / InstallHubFlow.ps1
Created October 9, 2017 09:07 — forked from mastilver/InstallHubFlow.ps1
Hubflow windows installer
Add-Type -AssemblyName System.IO.Compression.FileSystem
$TEMP = $([environment]::GetEnvironmentVariable("TEMP", "User"))
$CWD = $(Split-Path $MyInvocation.MyCommand.Path)
$PATH = $([environment]::GetEnvironmentVariable("PATH", "User"))
$git_folder = "C:\Program Files\Git"
$git_bin_folder = "$($git_folder)\bin"
$tmp_folder = "$($TEMP)\$([guid]::NewGuid())";
@tjrobinson
tjrobinson / gist:0ad6c790e90d7a385eb1
Last active July 12, 2018 02:55
ActiveDirectoryUserService.cs
using System;
using System.Collections.Generic;
using System.DirectoryServices.AccountManagement;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Thinktecture.IdentityServer.Core;
using Thinktecture.IdentityServer.Core.Models;
using Thinktecture.IdentityServer.Core.Services;
Split-Path -parent $dte.Solution.FileName | cd
New-Item -ItemType Directory -Force -Path ".\licenses"
@( Get-Project -All |
? { $_.ProjectName } |
% { Get-Package -ProjectName $_.ProjectName } ) |
Sort -Unique |
% { $pkg = $_ ; Try { (New-Object System.Net.WebClient).DownloadFile($pkg.LicenseUrl, (Join-Path (pwd) 'licenses\') + $pkg.Id + ".html") } Catch [system.exception] { Write-Host "Could not download license for $pkg" } }
@tjrobinson
tjrobinson / profanity.csv
Last active June 15, 2017 16:17
Profanity list for use with content filters
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
amcik
arse
arsehole
arserape
arsewipe
ass
asses
asshole
assholes
assramer
# Set environment variables for Visual Studio Command Prompt
# Based on: http://stackoverflow.com/questions/2124753/how-i-can-use-powershell-with-the-visual-studio-2010-command-prompt
$version=14
pushd "c:\Program Files (x86)\Microsoft Visual Studio ${version}.0\Common7\Tools"
cmd /c "vsvars32.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("=")
set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
input {
tcp {
type => "eventlog"
host => "10.1.1.2"
port => 3515
format => 'json'
}
}
@tjrobinson
tjrobinson / nuget-usage.ps1
Created August 2, 2013 08:45
Find NuGet packages across multiple solutions
$packagesInUse = @()
[xml] $nugetConfig = [xml](Get-Content nuget.config)
[System.Xml.XmlElement] $nugetConfigRoot = $nugetConfig.get_DocumentElement()
$repositoryPath = $nugetConfigRoot.SelectSingleNode("repositoryPath").InnerText
Write-Host "repositoryPath:" $repositoryPath
[xml] $repositories = [xml](Get-Content $repositoryPath\repositories.config)
[System.Xml.XmlElement] $repositoriesRoot = $repositories.get_DocumentElement()