FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
RustNumbers & durations

Construct an instant relative to the Unix epoch

Construct an instant relative to the Unix epoch in a complete Rust program using the standard library.

Rust✓ Tested
HTMLTables & list numbering

Continue an ordered list at a chosen number

HTML: The start attribute controls the initial ordinal without changing item text.

HTML✓ Tested
Arduino / CDigital input & output

Control an LED from a button

Translate an active-low button input into an LED output.

button✓ Tested
CSSType & reading flow

Control tab width in preformatted content

CSS: Tab-size defines the interval of tab stops in a preformatted block.

CSS✓ Tested
CSSVisual treatment & accessibility

Control the size of a repeated background tile

CSS: Background-size sets the rendered dimensions of each repeated background image.

CSS✓ Tested
PythonDates & time zones

Convert a duration to hours and minutes

Python: Use divmod to split nonnegative whole seconds into display components.

Python✓ Tested
Arduino / CSensor calculations

Convert a supplied ADC count to volts

Arduino / C: Scale a ten-bit ADC count using an explicit reference voltage.

Arduino / C✓ Tested
PythonDates & time zones

Convert a Unix timestamp to aware UTC

Python: Supply timezone.utc so the result does not depend on the machine time zone.

Python✓ Tested
Linux CommandsDates & process utilities

Convert a Unix timestamp to UTC

Linux Commands: Use the @ syntax with GNU date for seconds since the Unix epoch.

Linux Commands✓ Tested
PythonDates & time zones

Convert an aware datetime to another offset

Python: Use astimezone for conversion; replacing tzinfo alone does not convert an instant.

Python✓ Tested
JavaDates & time zones

Convert an instant to a regional timezone

Java: Use ZonedDateTime with a named zone to apply that zone’s offset rules.

Java✓ Tested
PowerShellStructured formats & encodings

Convert between hexadecimal text and bytes

PowerShell: Use the .NET hexadecimal helpers instead of parsing byte pairs manually.

PowerShell✓ Tested