This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type * as _htmx from "htmx.org"; | |
| declare global { | |
| var htmx: typeof _htmx; | |
| } | |
| declare module "htmx.org" { | |
| interface HtmxExtension { | |
| init(apiRef: HtmxInternalApi): void; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <label for="modal1">clicky boi</label> | |
| <input id="modal1" class="peer" type="checkbox" hidden /> | |
| <label for="modal1" class="hidden peer-checked:block bg-black bg-opacity-25 fixed h-full w-full top-0 left-0"></label> | |
| <dialog class="hidden peer-checked:block"> | |
| <p>lgtm ¯\_(ツ)_/¯</p> | |
| <label for="modal1">close</label> | |
| </dialog> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::{ | |
| hash::Hasher, | |
| io::{self, BufReader, Read}, | |
| }; | |
| /// The size of the buffer used when reading the file. | |
| const BUFFER_SIZE: usize = 8 * 1024; // 8 KB | |
| /// Hashes the contents of the given readable object (e.g. a file). | |
| #[inline] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macro_rules! fearless { | |
| ($t:ty) => { | |
| std::sync::Arc<std::sync::Mutex<$t>> | |
| }; | |
| ($e:expr) => { | |
| std::sync::Arc::new(std::sync::Mutex::new($e)) | |
| }; | |
| (clone $e:expr) => { | |
| std::sync::Arc::clone(&$e) | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class TripMap<K, V> { | |
| private map: Map<number, V>; | |
| constructor() { | |
| this.map = new Map<number, V>(); | |
| } | |
| private generateKey(...items: any[]): number { | |
| return [...new Set(items)] | |
| .map((x) => this.hash(x)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aclocal | |
| aclocal-1.16 | |
| activate-global-python-argcomplete | |
| acyclic | |
| add-apt-repository | |
| add-shell | |
| addgnupghome | |
| addgroup | |
| addpart | |
| addr2line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type TreeNode<V extends number = number, L = null, R = null> = { | |
| value: V; | |
| left: L; | |
| right: R; | |
| }; | |
| type BinarySearchTree<T = null> = { | |
| root: T; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::cmp::Ordering; | |
| use std::collections::BinaryHeap; | |
| const INF: u32 = u32::MAX; | |
| #[derive(Copy, Clone, Eq, PartialEq)] | |
| struct Edge { | |
| weight: u32, | |
| vertex: usize, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Logger { | |
| void error(String message, Throwable t); | |
| } | |
| class ConsoleLogger implements Logger { | |
| private final String className; | |
| ConsoleLogger(String className) { | |
| this.className = className; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { promises as fs } from 'fs'; | |
| import { v4 as uuidv4 } from 'uuid'; | |
| import { Mutex } from 'async-mutex'; | |
| interface Document { | |
| [key: string]: any; | |
| } | |
| interface Index { | |
| [key: string]: { [value: string]: string[] }; |