Skip to content

Instantly share code, notes, and snippets.

View riezebosch's full-sized avatar

Manuel Riezebosch riezebosch

View GitHub Profile
{
"variables": {
"vm_size": "Standard_DS13_v2",
},
"builders": [
{
"name": "azure-arm",
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",

asdf


using (var host = new HostBuilder()
        .ConfigureWebJobs(builder => builder
            .AddTimers()
            .AddDurableTaskInTestHub()
            .AddAzureStorageCoreServices()
            .ConfigureServices(services => services.AddSingleton(mock)))
 .Build())
@riezebosch
riezebosch / switch.cs
Last active October 4, 2019 07:11
exploring C# 8
public static IArgumentMatcher? Create(Expression arg) => arg switch
{
MethodCallExpression call when call.Method.DeclaringType == typeof(Arg) => call.Method.Name switch
{
nameof(Arg.Ignore) => (IArgumentMatcher)new IgnoreArgument(),
nameof(Arg.Where) => new LambdaArgument(call.Arguments.Single()),
_ => throw new InvalidOperationException()
},
_ => null
};
@riezebosch
riezebosch / Dockerfile
Last active June 24, 2019 12:10
containerization
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
WORKDIR /app
RUN dotnet new webapi
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet
ENV ASPNETCORE_URLS http://+:80
EXPOSE 80
WORKDIR /app
COPY --from=build-env /app/out ./
@riezebosch
riezebosch / test.cs
Created February 5, 2019 09:39
Polly Bulkhead
using System;
using System.Diagnostics;
using System.Threading;
using Microsoft.Extensions.Configuration;
using Polly;
using Polly.Bulkhead;
using Xunit;
namespace test
{
robocopy "\\some\share\containing\backup" "C:\some\local\drive" database-backup*.sqb /Z /ETA /TEE /W:2 /xo
$ErrorActionPreference = "Stop"
if ((Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online).State -ne 'Enabled') {
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online -All -NoRestart
}
if ((Get-WindowsOptionalFeature -FeatureName Containers -Online).State -ne 'Enabled') {
Enable-WindowsOptionalFeature -FeatureName Containers -Online -All -NoRestart
}
@riezebosch
riezebosch / Update-AUPackages.md
Last active November 29, 2021 06:06
Update-AUPackages Report #powershell #chocolatey
@riezebosch
riezebosch / rabbitmq.cs
Created January 25, 2018 16:00
Send drops message if no queue
public class RabbitMqSpecificTests : IClassFixture<RabbitMqOptions>
{
readonly RabbitMqOptions options;
string queue = $"{nameof(RabbitMqSpecificTests)}{nameof(CommandDissapearsIfNoQueue)}";
public RabbitMqSpecificTests(RabbitMqOptions options)
{
this.options = options;
EnsureQueueDeleted();
}
@riezebosch
riezebosch / Update-AUPackages.md
Last active November 29, 2021 06:05
Update-AUPackages Report #powershell #chocolatey