FIND YOUR NEXT FEW LINES

Results for “library”

Small, practical examples. Search by task or narrow things down below.

653 snippets foundClear filters
jQueryDeferred work & queues

Expose observation without exposing resolution

jQuery: promise returns an interface without resolve or reject methods.

jQuery✓ Tested
RustNumbers & durations

Express a duration in milliseconds

Express a duration in milliseconds in a complete Rust program using the standard library.

Rust✓ Tested
GoHTTP & URLs

Extract a route path variable

Extract a route path variable using a complete Go program with explicit sample inputs.

Go✓ Tested
GoStrings & text

Extract digit sequences

Extract digit sequences using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonFile operations & archives

Extract filename components

Python: Use pathlib properties to separate a directory, filename stem, and suffix.

Python✓ Tested
PythonText validation & encoding

Extract named regex fields

Python: Use named capture groups to parse a known date-shaped identifier.

Python✓ Tested
PythonStrings & dates

Extract numbers from text

Find all runs of ASCII digits in a string and convert the matches to integers.

regex✓ Tested
JavaText validation & formatting

Extract successive regex matches

Java: Use a Matcher loop to find all unsigned integer tokens in Java text.

Java✓ Tested
JavaText validation & formatting

Extract text between known positions

Java: Java substring uses a start-inclusive, end-exclusive range of UTF-16 indices.

Java✓ Tested
jQueryAnimation completion

Fade a hidden element into view

jQuery: fadeIn shows a hidden element and calls its completion handler.

jQuery✓ Tested
jQueryAnimation completion

Fade an element out and hide it

jQuery: fadeOut sets display none after the opacity animation finishes.

jQuery✓ Tested
jQueryHTTP requests

Fetch a plain-text resource

jQuery: An explicit text data type keeps the response as a string.

jQuery✓ Tested