Results for “pre”
Small, practical examples. Search by task or narrow things down below.
Find the length of a calendar month
C#: DaysInMonth applies the Gregorian leap-year rules.
C#✓ Tested
Forward input props to a reusable field
Forward input props to a reusable field with a small React component and explicit browser behavior.
React✓ Tested
Insert a list item at the beginning
jQuery: Learn how to insert a list item at the beginning in a complete browser example.
jQuery✓ Tested
Insert an item at the beginning
jQuery: prepend inserts before the existing children.
jQuery✓ Tested
Inspect the parsed pieces of a URL
JavaScript: Use URL properties rather than splitting a URL at punctuation.
JavaScript✓ Tested
Inspect the parsed pieces of a URL
TypeScript: Use URL properties rather than splitting a URL at punctuation.
TypeScript✓ Tested
List paths changed on a feature branch since its merge base
Git: A three-dot diff compares the branch tip with the common ancestor.
Git✓ Tested
Override an env-file value explicitly
Docker / Compose: The environment section takes precedence over env_file.
Docker / Compose✓ Tested
Parse a date without a time component
C#: DateOnly avoids attaching an irrelevant time or timezone to a calendar date.
C#✓ Tested
Parse an integer in another base
Java: Supply an explicit radix to Integer.parseInt.
Java✓ Tested
Percent-encode one URL component
JavaScript: encodeURIComponent escapes a parameter value rather than a complete URL.
JavaScript✓ Tested
Percent-encode one URL component
TypeScript: encodeURIComponent escapes a parameter value rather than a complete URL.
TypeScript✓ Tested