Results for “write text”
Small, practical examples. Search by task or narrow things down below.
Reuse colors with custom properties
Define a CSS custom property and use it for text color.
CSS✓ Tested
Round a decimal with an explicit rule
Java: Construct BigDecimal from text to avoid importing a binary floating-point approximation.
Java✓ Tested
Save a stream while displaying it
Linux Commands: Use tee to write a copy of standard input to a file.
Linux Commands✓ Tested
Serialize a hashtable as JSON
Produce compact JSON for a small data object.
JSON✓ Tested
Serialize an object
Turn a JavaScript object into JSON text.
JavaScript✓ Tested
Set a form field value
Populate a labeled input with jQuery val.
jQuery✓ Tested
Set a JSON property
Create an updated JSON document from existing text.
json_set✓ Tested
Set an element attribute
Update an HTML link using jQuery attr.
jQuery✓ Tested
Set owner-only file permissions
Linux Commands: Use chmod 600 to allow only the owner to read and write a file.
Linux Commands✓ Tested
Share data through a named volume
Keep a file across two short-lived containers.
volume✓ Tested
Show the first lines of a file
Read only the first three lines of a text file, useful for checking a header or previewing a large log.
head✓ Tested
Sort and deduplicate lines
Sort lines alphabetically and remove duplicate lines in a predictable C locale.
sort✓ Tested