Results for “led”
Small, practical examples. Search by task or narrow things down below.
Parse quoted CSV from an in-memory string
Python: Use StringIO with csv.reader so quoted commas are handled correctly.
Python✓ Tested
Perform cleanup even after an exception
C#: A finally block runs after a handled failure as well as after success.
C#✓ Tested
Put an optional service behind a profile
Keep a utility service separate from a normal Compose startup.
Compose✓ Tested
Reject a missing required configuration value
Bash Scripts: Check a required value explicitly and emit a controlled diagnostic before exiting.
Bash Scripts✓ Tested
Remove blank or whitespace-only lines
Linux Commands: Use a POSIX character class so tabs and spaces are handled together.
Linux Commands✓ Tested
Roll back a trial update
Group a change in a transaction and undo it.
transaction✓ Tested
Serialize successful controls for a URL-encoded request
jQuery: serialize includes named enabled controls and checked checkboxes.
jQuery✓ Tested
Set a form field value
Populate a labeled input with jQuery val.
jQuery✓ Tested
Show the current value of a range input
HTML: Mirror range input events into a labeled output for a native slider.
HTML✓ Tested
Start a command with a minimal environment
Linux Commands: Use env -i with an explicit PATH for a controlled child environment.
Linux Commands✓ Tested
Submit a readonly value while preventing edits
HTML: Readonly controls remain in form data, unlike disabled controls.
HTML✓ Tested
Type a function’s inputs and output
Catch mismatched arguments during compilation.
function✓ Tested