The snippet library.
Small, practical examples. Search by task or narrow things down below.
Sort timestamp strings by their parsed instants
TypeScript: Compare epoch values explicitly when date strings may contain different offsets.
TypeScript✓ Tested
Sort values in descending order
Linux Commands: Combine numeric sorting with reverse order.
Linux Commands✓ Tested
Sort values with LINQ
Create an ascending sequence from C# integer values.
C#✓ Tested
Sort version-like labels naturally
Linux Commands: Use GNU version sort to compare embedded digit runs numerically.
Linux Commands✓ Tested
Space items with gap
Use CSS gap instead of margins between flex children.
CSS✓ Tested
Span a grid item across multiple columns
CSS: Grid-column span counts tracks and includes the gaps between them.
CSS✓ Tested
Span a group header across several rows
HTML: Rowspan can label a group of related rows without repeating the label.
HTML✓ Tested
Span one header across several columns
HTML: Colspan lets a heading cover a defined number of columns in the table grid.
HTML✓ Tested
Specify a flex item’s initial main size
CSS: Flex-basis establishes the starting main-axis size before growth or shrinkage.
CSS✓ Tested
Split a file into fixed line-count pieces
Linux Commands: Use numeric suffixes for predictable filenames when splitting a large text file.
Linux Commands✓ Tested
Split a key-value pair once
Split a key-value pair once using a complete Go program with explicit sample inputs.
Go✓ Tested
Split a key-value pair once
Split a key-value pair once in a complete Rust program using the standard library.
Rust✓ Tested