View RoutingLinkBuilder.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using JsonApiDotNetCore.Configuration; | |
using JsonApiDotNetCore.Controllers; | |
using JsonApiDotNetCore.Middleware; | |
using JsonApiDotNetCore.Queries; | |
using JsonApiDotNetCore.Queries.Expressions; | |
using JsonApiDotNetCore.Queries.Internal.Parsing; |
View HttpCorrelation.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using CorrelationId; | |
using CorrelationId.Abstractions; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Options; |
View CreateSite.ps1
## FYI: These scripts are now maintained in a proper repository: | |
## https://github.com/alastairtree/deploy-websites-with-powershell | |
## Intro: Simple powershell script to install (or replace) a local website and app pool | |
## Usage: CreateSite.ps1 [WebsiteName] [AppPoolName] [Port] [Path] ([domain\user] [password]) | |
## Note : These scripts require local admin priviliges! | |
# Load IIS tools | |
Import-Module WebAdministration | |
sleep 2 #see http://stackoverflow.com/questions/14862854/powershell-command-get-childitem-iis-sites-causes-an-error |
View run-tests.ps1
Function TC-Escape ([string] $text){ | |
return $text.Replace("|","||").Replace("'","|'").Replace("\n","|n").Replace("\r","|r").Replace("[","|[").Replace("]","|}") | |
} | |
Function Invoke-Exec | |
{ | |
[CmdletBinding()] param([Parameter(Position=0,Mandatory=1)][scriptblock]$cmd) | |
$scriptExpanded = $ExecutionContext.InvokeCommand.ExpandString($cmd).Trim() |
View DevBox
choco install sql-server-management-studio –y | |
choco install git –y | |
choco install putty -y | |
choco install gitextensions -y | |
choco install vscode –y | |
choco install azure-data-studio –y | |
choco install 7zip –y | |
choco install nodejs-lts -y | |
choco install googlechrome -y | |
choco install firefox –y |
View RetryHelper.cs
public static class RetryHelper | |
{ | |
private static ILog logger = LogManager.GetLogger(); //use a logger or trace of your choice | |
public static void RetryOnException(int times, TimeSpan delay, Action operation) | |
{ | |
var attempts = 0; | |
do | |
{ | |
try |
View gist:6777218c2c7facc17282
$path = "C:\Sites\Website123" | |
$user = "domain\user" | |
$acl = Get-Acl $path | |
$arguments = $user, "ReadAndExecute", "ContainerInherit, ObjectInherit", "None", "Allow" | |
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $arguments | |
$acl.SetAccessRule($accessRule) |
View RetryHelperAsync.cs
using System; | |
using System.Configuration; | |
using System.Linq; | |
using System.Reflection; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using log4net; | |
namespace Utils | |
{ |
View Get-AADToken.ps1
# Original code from https://github.com/slavizh/OMSSearch/blob/master/OMSSearch.psm1 | |
# - Updated/fixed authentication method calls | |
# - Ensure ADAL DLL is loaded | |
Function Get-AADToken { | |
<# | |
.SYNOPSIS | |
Get token from Azure AD so you can use the other cmdlets. | |
.DESCRIPTION | |
Get token from Azure AD so you can use the other cmdlets. |
View my_boxstarter
choco install firefox -y | |
choco install 7zip -y | |
choco install putty -y | |
choco install notepadplusplus.install -y | |
choco install nuget.commandline -y | |
choco install git -y | |
choco install kdiff3 -y | |
choco install gitextensions -y | |
choco install vim -y | |
choco install fiddler4 -y |
NewerOlder