Skip to content

Instantly share code, notes, and snippets.

View christiansparre's full-sized avatar

Christian Sparre christiansparre

View GitHub Profile
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"copyOnSelect": true,
"initialCols": 220,
"initialRows": 55,
"profiles": [
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
@christiansparre
christiansparre / Sidebar.razor
Last active September 4, 2019 19:14
Test of Blazor component with child component requiring cascading value
<aside class="menu">
<p class="menu-label">
Something
</p>
<ul class="menu-list">
<li><a>This</a></li>
<li><a>And that</a></li>
</ul>
<AuthorizeView Policy="RequireAdmin">
<Authorized>
@christiansparre
christiansparre / Program.cs
Created September 12, 2018 09:55
MongoDB 4 concurrent transaction inserts to different collections
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Driver;
namespace MongoDB4Concurrency
{
class Program
{
@christiansparre
christiansparre / builddef.yaml
Created September 4, 2018 10:05
VstsDockerBuild VSTS YAML config
queue:
name: Hosted Linux Preview
steps:
- task: DockerCompose@0
displayName: 'Build and tag images'
inputs:
azureSubscription: '<<Azure Subscription Name>>'
azureContainerRegistry: '{"loginServer":"<<ACR Login server>>azurecr.io", "id" : "<<ACR id>>"}'
version: '3'
services:
vstsdockerbuild.tests:
environment:
- BLOWUP
image: vstsdockerbuild.tests
build:
context: .
dockerfile: tests/VstsDockerBuild.Tests/Dockerfile
@christiansparre
christiansparre / boxstarter.ps1
Last active November 2, 2019 13:32
Testing out Boxstarter
# Description: Boxstarter Script
# Author: Christian Sparre (modified from Jess Frazelle's)
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
@christiansparre
christiansparre / AzureQueueStorageSink.cs
Last active August 27, 2017 14:03
Azure Queue Storage Serilog Sink
public class AzureQueueStorageSink : ILogEventSink
{
CloudQueue _queue;
ITextFormatter _formatter;
public AzureQueueStorageSink(CloudQueue queue, ITextFormatter formatter)
{
_queue = queue;
_formatter = formatter;
}
@christiansparre
christiansparre / SysStop.cs
Created July 3, 2016 14:44
Sys.Stop(); not working as expected
[Fact]
public void should_terminate_but_does_not()
{
var a = CreateTestProbe();
Watch(a);
Sys.Stop(a);
ExpectTerminated(a);
@christiansparre
christiansparre / Program.cs
Created February 24, 2016 19:37
NancyFX vs Web API
using System;
using System.Web.Http;
using Microsoft.Owin.Hosting;
using Nancy;
using Owin;
namespace ConsoleApplication4
{
class Program
{
@christiansparre
christiansparre / reinstall.ps1
Created February 16, 2016 20:33
Reinstall nuget package
Param(
[string]$packageName,
[string]$source
)
UnInstall-Package $packageName -RemoveDependencies -Force -ErrorAction SilentlyContinue
Install-Package $packageName -IncludePreRelease -Source $source