Skip to content

Instantly share code, notes, and snippets.

View bjorkstromm's full-sized avatar
:shipit:
My hovercraft is full of eels

Martin Björkström bjorkstromm

:shipit:
My hovercraft is full of eels
View GitHub Profile
@bjorkstromm
bjorkstromm / Microsoft.Extensions.DependencyInjection.Abstractions.cs.diff
Created April 27, 2021 09:58
Microsoft.Extensions.DependencyInjection.Abstractions.cs.diff
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/ref/Microsoft.Extensions.DependencyInjection.Abstractions.cs b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/ref/Microsoft.Extensions.DependencyInjection.Abstractions.cs
index 02ba0389eea..a3b9edc9fd2 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/ref/Microsoft.Extensions.DependencyInjection.Abstractions.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/ref/Microsoft.Extensions.DependencyInjection.Abstractions.cs
@@ -8,22 +8,22 @@ namespace Microsoft.Extensions.DependencyInjection
{
public static partial class ActivatorUtilities
{
- public static Microsoft.Extensions.DependencyInjection.ObjectFactory CreateFactory([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type instanceType, System.Type[] argumentTypes) { throw null
@bjorkstromm
bjorkstromm / keybase.md
Created February 10, 2021 11:46
keybase.md

Keybase proof

I hereby claim:

  • I am bjorkstromm on github.
  • I am mholo65 (https://keybase.io/mholo65) on keybase.
  • I have a public key ASAHd41ids9ag679TjHuWUAICRle1Cc_6c_UljEGdLD1SQo

To claim this, I am signing this object:

@bjorkstromm
bjorkstromm / list-appinsights.ps1
Last active August 12, 2020 11:36
List Application Insights configurations for Web Apps and Function Apps
$webApps = ConvertFrom-Json([string](& az webapp list --query "[*].{name: name, resourceGroup: resourceGroup}" -o json))
$webApps | ForEach-Object {
Write-Host $_.Name
$settings = ConvertFrom-Json([string](& az webapp config appsettings list -n $_.name -g $_.resourceGroup --query "{APPINSIGHTS_INSTRUMENTATIONKEY: [?name=='APPINSIGHTS_INSTRUMENTATIONKEY'].value | [0], APPLICATIONINSIGHTS_CONNECTION_STRING: [?name=='APPLICATIONINSIGHTS_CONNECTION_STRING'].value | [0]}"))
$_ | Add-Member -NotePropertyName APPINSIGHTS_INSTRUMENTATIONKEY -NotePropertyValue $settings.APPINSIGHTS_INSTRUMENTATIONKEY
$_ | Add-Member -NotePropertyName APPLICATIONINSIGHTS_CONNECTION_STRING -NotePropertyValue $settings.APPLICATIONINSIGHTS_CONNECTION_STRING
}
$funcApps = ConvertFrom-Json([string](& az functionapp list --query "[*].{name: name, resourceGroup: resourceGroup}" -o json))
$funcApps | ForEach-Object {
@bjorkstromm
bjorkstromm / frontdoor.ps1
Created June 1, 2020 10:05
Front Door - Access Restrictions
$ResourceGroup = "<your RG>"
$AppName = "<your App>"
az webapp config access-restriction add --priority 100 --action Allow -g $ResourceGroup -n $AppName --rule-name FrontDoor_13.73.248.16/29 --ip-address 13.73.248.16/29
az webapp config access-restriction add --priority 100 --action Allow -g $ResourceGroup -n $AppName --rule-name FrontDoor_20.36.120.104/29 --ip-address 20.36.120.104/29
az webapp config access-restriction add --priority 100 --action Allow -g $ResourceGroup -n $AppName --rule-name FrontDoor_20.37.64.104/29 --ip-address 20.37.64.104/29
az webapp config access-restriction add --priority 100 --action Allow -g $ResourceGroup -n $AppName --rule-name FrontDoor_20.37.156.120/29 --ip-address 20.37.156.120/29
az webapp config access-restriction add --priority 100 --action Allow -g $ResourceGroup -n $AppName --rule-name FrontDoor_20.37.195.0/29 --ip-address 20.37.195.0/29
az webapp config access-restriction add --priority 100 --action Allow -g $ResourceGroup -n $AppName --rule-name FrontDoor_20.37.224.1
#line 1 "B3437BF2-8AE3-4281-8726-B926BB9DF75D"
/// <summary>
/// Determines whether or not the specified argument exist.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="name">The argument name.</param>
/// <returns>Whether or not the specified argument exist.</returns>
/// <example>
/// This sample shows how to call the <see cref="M:Cake.Common.ArgumentAliases.HasArgument(Cake.Core.ICakeContext,System.String)" /> method.
/// <code>
@bjorkstromm
bjorkstromm / Xamarin.cshrml
Created August 8, 2019 20:14
Xamarin Gazorator
@inherits Gazorator.Scripting.RazorScriptHost<AndroidBinderator.BindingProjectModel>
@using System.Linq
@using System.Xml.Linq
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>MonoAndroid90</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
@if (!string.IsNullOrEmpty(Model.AssemblyName))
{
@bjorkstromm
bjorkstromm / program.cs
Created July 17, 2019 22:10
Catalog ids from Registration
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace ConsoleApp3
Stop-Service Docker
Stop-Service HNS
rm C:\ProgramData\Microsoft\Windows\HNS\HNS.data
rm C:\ProgramData\docker\network\files\local-kv.db
Start-Service HNS
Start-Service Docker
using NuGet.Common;
using NuGet.Configuration;
using NuGet.Frameworks;
using NuGet.Packaging;
using NuGet.Packaging.Core;
using NuGet.Packaging.Signing;
using NuGet.Protocol;
using NuGet.Protocol.Core.Types;
using NuGet.Resolver;
using NuGet.Versioning;
@bjorkstromm
bjorkstromm / ReactiveUI.Tests.csproj.build
Created October 18, 2017 07:56
ReactiveUI Tests build failed.
10>------ Rebuild All started: Project: ReactiveUI.Tests, Configuration: Debug Any CPU ------
10>C:\Users\mb\src\gh\ReactiveUI\src\ReactiveUI.Tests\ReactiveUI.Tests.csproj : error NU1202: Package Microsoft.Win32.Primitives 4.0.1 is not compatible with net452 (.NETFramework,Version=v4.5.2). Package Microsoft.Win32.Primitives 4.0.1 supports:
10>C:\Users\mb\src\gh\ReactiveUI\src\ReactiveUI.Tests\ReactiveUI.Tests.csproj : error NU1202: - monoandroid10 (MonoAndroid,Version=v1.0)
10>C:\Users\mb\src\gh\ReactiveUI\src\ReactiveUI.Tests\ReactiveUI.Tests.csproj : error NU1202: - monotouch10 (MonoTouch,Version=v1.0)
10>C:\Users\mb\src\gh\ReactiveUI\src\ReactiveUI.Tests\ReactiveUI.Tests.csproj : error NU1202: - net46 (.NETFramework,Version=v4.6)
10>C:\Users\mb\src\gh\ReactiveUI\src\ReactiveUI.Tests\ReactiveUI.Tests.csproj : error NU1202: - netstandard1.3 (.NETStandard,Version=v1.3)
10>C:\Users\mb\src\gh\ReactiveUI\src\ReactiveUI.Tests\ReactiveUI.Tests.csproj : error NU1202: - xamarinios10 (Xamarin.iOS,Version=v1