FIND YOUR NEXT FEW LINES

Results for “script”

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

407 snippets foundClear filters
HTMLImages & embedded documents

Allow embedded scripts without granting same-origin access

HTML: Grant only allow-scripts so the sandboxed document retains an opaque origin.

HTML✓ Tested
Docker / ComposeGetting Started

Attach a descriptive label to a container

Docker / Compose: Attach a descriptive label to a container using a locally available Ubuntu image.

Docker / Compose✓ Tested
HTMLImages & embedded documents

Block scripts in an embedded document

HTML: An empty sandbox attribute applies the default set of restrictions, including blocking script execution.

HTML✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Check a script’s syntax without executing its body

Bash Scripts: bash -n parses commands but does not run ordinary script statements.

Bash Scripts✓ Tested
Bash ScriptsGetting Started

Choose between two script branches

Bash Scripts: Choose between two script branches with a small standalone Bash program.

Bash Scripts✓ Tested
ReactEffects & lifecycle

Clean up a subscription when a child unmounts

Clean up a subscription when a child unmounts with a small React component and explicit browser behavior.

React✓ Tested
ReactGetting Started

Display a JavaScript value in JSX

Display a JavaScript value in JSX with a small React component and explicit browser behavior.

React✓ Tested
HTMLMetadata & document links

Give a document a descriptive browser title

HTML: The title element supplies the browser document title independently of the visible heading.

HTML✓ Tested
Bash ScriptsFunction scope & composition

Load functions from a trusted local script

Bash Scripts: Source executes a file in the current shell so its function definitions remain available.

Bash Scripts✓ Tested
Linux CommandsFiles & permissions

Make a script executable by its owner

Linux Commands: Add the owner execute bit without replacing all permission bits.

Linux Commands✓ Tested
HTMLDocument structure

Pair terms and descriptions

Use a description list for a small HTML glossary.

HTML✓ Tested
HTMLMetadata & document links

Provide a concise page description

HTML: A description meta element summarizes a document for clients that use that metadata.

HTML✓ Tested