Skip to content

Instantly share code, notes, and snippets.

View EliahKagan's full-sized avatar

Eliah Kagan EliahKagan

View GitHub Profile
@EliahKagan
EliahKagan / cities.py
Last active March 4, 2020 01:47
finding rare false positives of \L<city>\Wescorts?
#!/usr/bin/env python3
# From https://github.com/Charcoal-SE/SmokeDetector/blob/master/findspam.py
city_list = [
"Agra", "Ajanta", "Almora", "Alwar", "Amritsar", "Andheri",
"Bangalore", "Banswarabhiwadi", "Bhilwara", "Bhimtal", "Bhiwandi", "Bhopal",
"Calcutta", "Calicut", "Chandigarh",
"Chennai", "Chittorgarh", "Coimbatore", "Colaba",
"Darjeeling", "Dehradun", "Dehrdun", "Delhi", "Durgapur",
"Ernakulam", "Faridabad",
// SPDX-License-Identifier: 0BSD
/// <summary>A few fragments of a BST implementation.</summary>
public sealed class AltTreeMap<TKey, TValue> {
public AltTreeMap() : this(Comparer<TKey>.Default) { }
public AltTreeMap(IComparer<TKey> comparer)
=> Comparer = comparer;
public IComparer<TKey> Comparer { get; }
@EliahKagan
EliahKagan / Graph.cs
Last active January 22, 2023 17:42
C# local functions example
// Copyright (c) 2020 Eliah Kagan
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
@EliahKagan
EliahKagan / .gitignore
Last active May 1, 2021 09:59
example of a recursive anonymous class in Java
*.class
cmake_minimum_required(VERSION 3.0.0)
project(fibonacci-memoized VERSION 0.1.0)
include(CTest)
enable_testing()
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@EliahKagan
EliahKagan / README.md
Last active January 23, 2023 05:26
code fence cleanup - finding broken code fences
@EliahKagan
EliahKagan / .gitignore
Last active January 23, 2023 05:44
CodeFenceCleanup - scripts for finding posts with broken code fences
# Cached Python modules
__pycache__/
# Output files
out[0-9]
# This branch has been rebased to not track .csv files. To keep it that way...
*.csv
@EliahKagan
EliahKagan / LICENSE
Last active April 30, 2021 22:35
strange slow performance of BigInteger.Pow
Copyright (c) 2020 Eliah Kagan <degeneracypressure@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
@EliahKagan
EliahKagan / README.md
Last active August 31, 2021 03:04
linear-time subtree search
@EliahKagan
EliahKagan / LICENSE
Last active April 30, 2021 21:42
Crystal type examples
Copyright (c) 2020 Eliah Kagan <degeneracypressure@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR