Sharded Concurrent Map
Reduce lock contention with a fixed set of independently locked shards, safe for concurrent writes from many goroutines.
Page 9 of 14
Reduce lock contention with a fixed set of independently locked shards, safe for concurrent writes from many goroutines.
Track request timestamps in a sliding window to enforce a precise per-interval quota, with an injectable clock for tests.
Broadcast events to browser clients over text/event-stream with per-client buffers, dropped slow consumers, and flush calls.
Run a child process under a context deadline, capture stdout and stderr together, and report a clear timeout error.
Pick items with arbitrary positive weights using one random draw, rejecting bad weights and checking the distribution.
Decode YAML into typed structs with unknown-field rejection, then validate required addresses, durations, and size limits.
Build a native HTML modal with showModal, labelled and described content, Escape and backdrop dismissal, and a live result message.
Style a native multiple file input with a focusable label button, announce selected files, and reject oversized files before upload.
Validate a signup form with a focusable error summary, linked error messages, aria-invalid states, and a polite success announcement.
Sort an HTML data table with real buttons, keep aria-sort on the active column, and announce each sort change to screen readers.
Run a batch on a fixed thread pool with invokeAll and a deadline, inspect completed futures, and shut the executor down cleanly.
Validate and normalize a Java record in its compact constructor, default missing display names, and defensively copy a role list.
Aggregate sales with Collectors groupingBy, TreeMap ordering, and teeing to compute count and average in one pass over a Java stream.
See how Java closes resources in reverse order and attaches a failing close to the primary exception as a suppressed throwable.
Parse Accept headers with q-values and wildcards, then pick the best supported media type while honoring q=0 exclusions and server order.
Compute exact years, months and days between a birth date and a reference date using UTC date-only arithmetic.
Split arrays or any iterable into fixed-size chunks with strict size validation, ordered output and a lazy generator variant.
Combine parallel arrays into tuples and split a collection by predicate, with a zipLongest variant that pads short inputs.
Serialize critical sections with an async mutex that queues waiters in FIFO order, supports acquisition timeouts and safe double release.
Check whether parentheses, square brackets and braces are balanced and correctly nested with a single-pass stack algorithm.
Encode UTF-8 text with the RFC 4648 Base32 alphabet, add correct padding, and decode back while rejecting invalid characters.
Encode strings or bytes to unpadded base64url and decode back with strict alphabet, length and fatal UTF-8 validation.
Find the first and last insertion points for a value in a sorted array with a custom comparator, then count duplicates in logarithmic time.
Represent up to 30 permissions as one 32-bit mask with helpers to build, test, add, remove, toggle and list enabled flags.
Find a strict majority element in linear time and constant space, plus a generalized Misra-Gries pass for multiple frequent values.
Append a stable version or content-hash query parameter to asset URLs without losing existing params or fragments.
Shift ASCII letters by any integer offset with alphabet wrapping, and expose ROT13 as a fixed thirteen-position special case.
Convert identifiers between camelCase, snake_case and kebab-case with word-boundary splitting, input validation and predictable output.
A cooperative cancellation primitive with reasons, unsubscribe callbacks, throwIfCancelled and linked token sources that cascade cancellation.
Parse MM/YY card expiry values, compare them against an injectable clock and report whether the card is valid through month end.
Format large counts as 1.2K or 3.4M with Intl.NumberFormat compact notation and configurable locale and precision.
Map over an array with a fixed concurrency limit, preserve result order, propagate the first error, and honor an AbortSignal.
Compare secrets without early exit by XOR-ing UTF-8 bytes, reducing timing leaks in token and signature checks.
Parse attachment and inline headers, including RFC 5987 filename*, while stripping directory components from untrusted names.
Parse a Cookie request header into a null-prototype object, handling quoted values, duplicates and RFC 6265 rules.
Serialize browser cookies with Max-Age, Expires, Path, Domain, Secure, HttpOnly and SameSite, plus a tolerant Cookie header parser.
Parse one CSV row with a configurable delimiter, quoted fields, doubled quotes and strict errors for malformed input.
Incrementally parse CSV chunks with quoted fields, escaped quotes, embedded newlines, and CRLF endings using a dependency-free state machine.
Transform multi-argument functions into curried variants that support placeholders and partial application.
Recursively freeze arrays and objects while tolerating cycles, accessors and typed arrays that cannot be frozen with elements.
Merge nested configuration objects without mutation, cloning arrays and special values while blocking prototype-pollution keys.
A growable ring-buffer deque with amortized O(1) pushes and pops at both ends, plus indexed snapshot access.
Normalize local and international phone input into E.164 format with country dial codes, trunk-prefix handling and length checks.
Mask the local part of email addresses while preserving the domain, with short-address handling and an option to hide subdomains.
Parse entity-tag lists and evaluate If-Match and If-None-Match with the strong or weak comparison rules required by HTTP caching.
A small event emitter that adds one-shot listeners, removal by original callback, snapshot dispatch and listener counts without Node dependencies.
Shuffle arrays in place or on a copy using crypto-backed rejection sampling to avoid modulo bias and preserve uniform permutations.
Flatten arbitrarily nested arrays with an explicit stack and optional depth limit, avoiding call-stack overflow on deep input.
Turn raw byte counts into readable IEC or SI strings with configurable decimals, spacing and correct handling of zero and negatives.
Group array items by a computed key or property name into a Map that preserves first-seen key order and supports value projection.
Build a max heap and sort an array in place in O(n log n) time with no extra allocations, using a pluggable comparator for custom orders.
Parse three- and six-digit hex colors into RGB channels and convert validated RGB objects back to lowercase hex strings.
Validate DNS hostnames label by label, enforcing length limits, allowed characters, hyphen placement and an optional root dot.
Escape ampersands, angle brackets, quotes and newlines before inserting untrusted values into HTML or attributes.
Generate Cache-Control and ETag headers, then evaluate If-None-Match and If-Modified-Since to return 304 or 200 responses correctly.
Format Dates as IMF-fixdate for HTTP headers and parse all three legacy HTTP date formats into Date objects.
Classify HTTP status codes by class and expose retryable, cacheable, success and error flags for client logic.
Convert milliseconds into compact durations such as 1h 5m 20s with unit limits, short labels and zero handling.
Parse INI configuration into null-prototype objects with sections, comments, quoted values, type coercion and duplicate detection.
Parse dotted-quad IPv4 addresses strictly, reject leading zeros, and classify private, loopback and link-local ranges.
Calculate ISO 8601 week numbers and convert a year plus week back to the Monday that starts it, with round-trip validation.
Write newline-delimited JSON logs with levels, child context, timestamps, and safe serialization of errors, circular data, and BigInt.
Apply RFC 7386 merge patches without mutating the target, treating null as deletion, replacing arrays and rejecting unsafe object keys.
Resolve, assign and delete values with RFC 6901 JSON Pointers, including escape handling, array indexes and prototype pollution guards.
Apply Gregorian leap-year rules and return the exact number of days in any month, including February in leap and common years.
Compute edit distance over Unicode code points and reconstruct insert, delete and substitute steps from the dynamic-programming matrix.
Compare two multi-line strings with a longest-common-subsequence diff and return ordered equal, delete, and insert operations.
Validate payment card numbers with the Luhn algorithm, tolerate spaces and hyphens, and compute the missing check digit.
Rotate a square matrix clockwise or counter-clockwise in place using a transpose and row reversal, with square-shape validation.
Cache expensive function results by a custom key with per-entry TTL, bounded size, eviction, hit statistics, and manual invalidation.
Validate, sort and merge closed numeric intervals, combining overlapping and exactly touching ranges without mutating the input array.
Implement a dependency-free binary min-heap with a custom comparator for O(log n) priority queue pushes and pops.
Compute ISO 7064 mod-97 check digits and validate long number strings without exceeding JavaScript safe integer precision.
Build a flat seven-column calendar grid for any month, honoring a configurable first weekday and blank padding cells.
Sort file names and labels naturally so item2 comes before item10, using Intl.Collator with a deterministic tie-break.
Build inclusive numeric ranges with positive or negative steps, validate inputs and stream large ranges lazily through a generator.
Read and copy-on-write nested values with dot and bracket paths while blocking proto, constructor and prototype segments.
Wrap sync and async functions so initialization runs at most once, sharing the cached result or in-flight promise.
Turn integers into 1st, 2nd, 3rd and 11th using Intl.PluralRules ordinal categories with a safe fallback.
Estimate password entropy from character pools, unique characters and common patterns to produce a five-level score.
Calculate relative change between two numbers and format the result with fixed decimals, an explicit plus sign and locale-free output.
Build small reusable data pipelines with pipe in left-to-right order and compose in reverse, including argument validation.
Choose singular or plural forms by CLDR plural category, including custom two and few forms for non-English locales.
Run many async tasks with a fixed concurrency limit while keeping results in input order and rejecting invalid pool sizes.
Sort arrays in place with a three-way partition that groups equal keys, avoiding quadratic behavior when many duplicate values are present.
Find the k-th smallest value in average linear time with randomized quickselect, zero-based ranks and a non-mutating input copy.
Parse a raw HTTP header block with obsolete line folding, duplicate fields, Set-Cookie arrays, case-insensitive names and size limits.
Escape every regular-expression metacharacter so user input can be matched literally, with a helper that rejects stateful flags.
Format timestamps as localized labels such as yesterday or in 2 hours, reusing cached Intl.RelativeTimeFormat instances.
Uniformly sample a fixed number of items from arrays or one-pass iterables using reservoir sampling with an injectable random source.
Parse Retry-After delay-seconds or HTTP-date values into milliseconds, clamp them to a maximum and correct for server clock skew.
Convert integers from 1 to 3999 into Roman numerals and parse valid numerals back to numbers with subtraction and validation.
Encode repeated characters into compact count-letter runs and decode them back with strict validation of malformed input.
Compute the maximum of every fixed-size window in O(n) using a monotonic deque, with clear handling of invalid sizes.
Normalize accented text into clean URL slugs with NFKD decomposition, diacritic stripping, length limits and a safe fallback value.
A tiny dependency-free spy that records calls, supports return stubs and resolved values, and resets between tests.
Sort records by several key selectors and directions with a guaranteed original-index tiebreak, so equal rows never swap positions.
Track the minimum of a numeric stack in constant time using a parallel minimum stack, without scanning elements.
Read an async iterable stream into a string while enforcing a hard byte ceiling and destroying the source as soon as it overflows.
Render double-brace placeholders from a plain object, raising clear errors for missing keys instead of silently printing undefined.