Skip to content

Instantly share code, notes, and snippets.

View evan-choi's full-sized avatar
🎯
Focusing

Evan evan-choi

🎯
Focusing
View GitHub Profile
@evan-choi
evan-choi / ObjectSelector.cs
Last active August 5, 2021 00:44
ObjectSelector is a simple class written for navigating nested object properties.
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:
@evan-choi
evan-choi / ReadOnlySequenceExtension.cs
Created October 14, 2021 15:36
ReadOnlySequence SequenceEquals
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;
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 {