Skip to content

Instantly share code, notes, and snippets.

View Klotzi111's full-sized avatar

Klotzi111

  • Germany
  • 05:20 (UTC +01:00)
View GitHub Profile
using System.Collections.Concurrent;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
public sealed class StronglyTypedIdValueConverterSelector : ValueConverterSelector
{
// The dictionary in the base type is private, so we need our own one here.
private readonly ConcurrentDictionary<(Type ModelClrType, Type ProviderClrType), ValueConverterInfo> _converters = new();
public StronglyTypedIdValueConverterSelector(ValueConverterSelectorDependencies dependencies) : base(dependencies)
{ }
@Klotzi111
Klotzi111 / base64.lua
Last active October 8, 2025 00:16 — forked from SquidDev/clone.lua
A tiny git clone library. Supports user authentication (with non ASCII characters)
-- From: https://github.com/philanc/plc/blob/9efed4113a1a5dcb12a1f526cd65561756e6d648/plc/base64.lua
--
-- Modified by Klotzi to work with Lua 5.2:
-- replaced all bit operations with bit32 functions
-- Copyright (c) 2015 Phil Leblanc -- see LICENSE file
------------------------------------------------------------------------
-- base64 encode / decode
@Klotzi111
Klotzi111 / win-125x.lua
Last active October 8, 2025 00:03 — forked from Egor-Skriptunoff/win-125x.lua
String converter between Windows ANSI and UTF-8 encodings
-- From: https://gist.github.com/Egor-Skriptunoff/44a88f64f9a497919db4ad8c28259a8f
-- Modified by Klotzi to:
-- - take codepage as a parameter on each call
-- - cache decompressed mappings
-- - don't clutter global namespace
---------------------------------------------------------------------
-- Converter between win-125x and UTF-8 strings
---------------------------------------------------------------------
-- Written in pure Lua, compatible with Lua 5.1-5.4
@Klotzi111
Klotzi111 / combined_future.py
Last active November 16, 2023 00:19
Python CombinedFuture
import concurrent
from concurrent.futures import Future
from typing import Any
class CombinedFuture(Future[Future | None]):
"""
This class provides "waiting" mechanisms similar to concurrent.futures.wait(...) except that there is no blocking wait.
This class extends concurrent.futures.Future and thus it can be used like any other Future.
You can use the .result() and .done() (and other) methods and also use this class with the aforementioned concurrent.futures.wait function.