Skip to content

Instantly share code, notes, and snippets.

View tuscen's full-sized avatar
🐼

Aleksey Usatov tuscen

🐼
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
namespace MihaZupan
{
/// <summary>
/// A simple request scheduler to help you conform to rate limiting
/// </summary>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace MihaZupan
{
// Block the caller of WaitOne as long as necesarry
public class RequestScheduler
@sliekens
sliekens / DiscriminatedJsonConverter.cs
Last active December 15, 2022 19:24
Configurable JsonConverter for deserializing discriminated JSON
using System;
using System.Diagnostics;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Infrastructure
{
public sealed class DiscriminatedJsonConverter : JsonConverter
{
@mburbea
mburbea / ValueMarker.cs
Last active December 16, 2025 15:35
An attempt at creating a variant type that avoids boxing.
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace ValueMarkerPrototype;
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct ValueMarker
{
private readonly nint _storage;
private readonly object _object;