Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Evan evan-choi

🎯
Focusing
View GitHub Profile
View fuzzy.ts
export default class Fuzzy {
readonly score: number;
readonly ranges: Range[];
constructor(score: number, ranges: Range[]) {
this.score = score;
this.ranges = ranges;
}
static analyze(term: string, query: string): Fuzzy {
@evan-choi
evan-choi / ReadOnlySequenceExtension.cs
Created Oct 14, 2021
ReadOnlySequence SequenceEquals
View ReadOnlySequenceExtension.cs
using System;
using System.Buffers;
public static class ReadOnlySequenceExtension
{
public static bool SequenceEquals<T>(in this ReadOnlySequence<T> a, in ReadOnlySequence<T> b) where T : IEquatable<T>
{
if (a.Length != b.Length)
return false;
@evan-choi
evan-choi / ObjectSelector.cs
Last active Aug 5, 2021
ObjectSelector is a simple class written for navigating nested object properties.
View ObjectSelector.cs
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
/*
* Syntax: