🤹♂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.EntityFrameworkCore.Infrastructure; | |
using Microsoft.EntityFrameworkCore.Migrations; | |
// ReSharper disable InconsistentNaming | |
#region migrations | |
[Migration(nameof(Script1))]public class Script1 : MigrationConfiguredWithScriptDirectoryAndDbContext{} | |
[Migration(nameof(Script2))]public class Script2 : MigrationConfiguredWithScriptDirectoryAndDbContext{} | |
#endregion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Security.Claims; | |
using System.Security.Principal; | |
public class FakeClaimsIdentity : ClaimsIdentity | |
{ | |
public readonly List<Claim> ClaimsValue = new List<Claim>(); | |
public bool IsAuthenticatedSet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace System.Diagnostics | |
using namespace System.Collections | |
using namespace System.Collections.Generic | |
using namespace System.IO.Compression | |
param ( [switch]$NoRun ) | |
function Assert( [bool]$condition, [string]$message = "Assertion failed" ){ | |
if( -not $condition ) { | |
Get-PSCallStack | ForEach-Object { Write-Host $_.FunctionName $_.Location $_.Arguments } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Populate Web.config EnvironmentVariables from Pipeline variables | |
# | |
# Usage: Copy-paste this script into a Powershell Task, as an inline script, in your release pipeline. | |
# | |
# ----------------------------------------------------- | |
# Known Variables: | |
# DOTNET_ENVIRONMENT | |
# TraceTransforms | |
# ----------------------------------------------------- | |
# Editing this script: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task: PowerShell@2 | |
displayName: "Dev Azure tasks and GOTCHAS" | |
inputs: | |
targetType: 'inline' | |
script: | | |
# Write your PowerShell commands here. | |
@" | |
DevAzure tasks and GOTCHAS: NuGet.config, MsBuild Path, Unit Tests, Integration Tests | |
"@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// A SoftDictionary is a <see cref="Dictionary{TKey,TValue}"/> which does not | |
/// throw if you try to to access a non-existent entry. Instead, it returns <c>default(TValue)</c> | |
/// </summary> | |
/// <typeparam name="TKey"></typeparam> | |
/// <typeparam name="TValue"></typeparam> | |
public class SoftDictionary<TKey,TValue> : Dictionary<TKey,TValue> where TKey : notnull | |
{ | |
/// <inheritdoc cref="IDictionary{TKey,TValue}"/> | |
/// <remarks> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Extensions of <see cref="string.Join"/> | |
/// </summary> | |
public static partial class StringJoin | |
{ | |
/// <summary> | |
/// Concatenates the elements of a specified array or collection, | |
/// using the specified separator between each element or member, | |
/// but omitting null strings. | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using EFCoreAndDomainModels.Application; | |
using EFCoreAndDomainModels.Domain; | |
using EFCoreAndDomainModels.Infrastructure; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.Design; | |
using TestBase; | |
using Xunit.Abstractions; | |
namespace EFCoreAndDomainModels |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env sh | |
cat << 'EOF' | |
Get pricing: | |
location.href="https://prices.azure.com/api/retail/prices?$skip=0¤cyCode='GBP'&$filter=location eq 'UK South' and serviceName eq 'Virtual Machines' and priceType eq 'Consumption'" | |
Create Spot VM | |
az vm create -g VM --name VM --admin-username azureuser --image CentOS --generate-ssh-keys --public-ip-sku Standard --priority Spot --eviction-policy Delete | |
Destroy VM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Dependency: dotnet add package Azure.Storage.Blobs | |
// #r "nuget:Azure.Storage.Blobs" | |
// | |
// Parallel download blobs from an Azure Blob Storage container, and report speed and bandwidth metrics | |
// As is, this code searches for blobs by index tag. To download by virtual folder instead, | |
// replace blobItems = containerClient.FindBlobsByTags(indexTagFilter) with | |
// blobItemsUntagged = containerClient.GetBlobs(); | |
// | |
using System.Diagnostics; |
NewerOlder