Skip to content

Instantly share code, notes, and snippets.


Stephan zpqrtbnk

View GitHub Profile
View HazelcastIssue466.cs
// Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
View NullCoalesceBenchmark
// executed with:
// var config = DefaultConfig.Instance
// BenchmarkRunner.Run(typeof(NullCoalesce), config);
public class NullCoalesce
private bool _toggle;
zpqrtbnk / NamedServiceExtensions.cs
Last active Jan 11, 2019
Named Services for MS.DI
View NamedServiceExtensions.cs
using System;
using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
namespace MSDI
public static class NamedServiceExtensions
zpqrtbnk / ValueTuple3Benchmark.cs
Last active May 31, 2020
ValueTuple Benchmark
View ValueTuple3Benchmark.cs
using System;
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Validators;
// here are the results I get:
zpqrtbnk / Test.cs
Last active Aug 29, 2015
Recurse Vs Stack Benchmark
View Test.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestRunner
zpqrtbnk /
Last active Mar 20, 2018
Markdown Sandbox

Umbraco Version 8 Technical Notes


zpqrtbnk / ContentSet.cshtml
Last active Dec 23, 2015
Demo usage of ToContentSet()
View ContentSet.cshtml
// IPublishedContent implements IsFirst, IsOdd, Index and various stuff
// so technically it's possible to do
@foreach(var content in contents)
<div class="@(content.IsFirst() ? "first" : "") @(content.IsOdd() ? "odd" : "even")" id="item-@(content.Index())">
// however, because of some issues in IPublishedContent, IsFirst, IsOdd, Index... all
zpqrtbnk / Article.cs
Last active Dec 22, 2015
Umbraco strongly typed published content experiments
View Article.cs
// demo of a basic strongly typed published content for an article
// you just need to drop the following class anywhere in your code
// and every strongly typed methods returning IPublishedContent will
// actually return an Article instance (which is an IPublishedContent)
// we want the class named Article though the content type alias is 'newsArticle'
public partial class Article : PublishedContentModel
public Article(IPublishedContent content)