Skip to content

Instantly share code, notes, and snippets.

from pathlib import Path
ROOT = Path(r"a/b/c/d")
BOM_UTF8 = b"\xEF\xBB\xBF"
def strip_utf8_bom(path: Path) -> bool:
data = path.read_bytes()
if not data.startswith(BOM_UTF8):
@f2koi-shiftup
f2koi-shiftup / reflection.cs
Created July 8, 2025 04:11
Find System.Linq.Queryable.Where<TSource> by reflection
public static class A
{
private static MethodInfo WhereMethodInfo()
{
var tSource = typeof(Queryable)
.GetMethods()
.Where(m => m.Name == nameof(Queryable.Where))
.First()
.GetGenericArguments()[0];
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.