Skip to content

Instantly share code, notes, and snippets.

View sojournercntl's full-sized avatar
🌌
at work

Marcus sojournercntl

🌌
at work
View GitHub Profile
using System;
using System.Threading.Tasks;
namespace System.Collections.Concurrent
{
public static class ConcurrentDictionaryExtensions
{
/// <summary>
/// Provides an alternative to <see cref="ConcurrentDictionary{TKey, TValue}.GetOrAdd(TKey, Func{TKey, TValue})"/> that disposes values that implement <see cref="IDisposable"/>.
/// </summary>
@sojournercntl
sojournercntl / MinimalAPIs.md
Created April 14, 2022 17:03 — forked from davidfowl/MinimalAPIs.md
Minimal APIs at a glance
@sojournercntl
sojournercntl / DiscordRpc.cs
Created March 13, 2018 23:28 — forked from dtzxporter/DiscordRpc.cs
Discord Rpc .NET
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
//
// Discord Rpc Wrapper for .NET Framework (DTZxPorter) 12/26/2017
// Wrapper created using the open-source discord-rpc extension at:
@sojournercntl
sojournercntl / gist:36f7ac765a5d4dbe0b2d90e6dc223e8e
Created October 29, 2017 22:42 — forked from hansmaad/gist:9187633
WPF Flat Combo Box Style
<!-- Flat ComboBox -->
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" />
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" />
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" />
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" />
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" />
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate">
<Grid>
<Grid.ColumnDefinitions>