def fibonacci(n):
"""Generate Fibonacci sequence."""
a, b = 0, 1
for _ in range(n):
yield a
a, b = b, a + b
print(list(fibonacci(10)))const fetchData = async (url) => {
const response = await fetch(url);
const data = await response.json();
return data;
};
// Usage
fetchData('https://api.example.com/posts')
.then(posts => console.log(posts));#!/bin/bash
for file in *.org; do
echo "Processing: $file"
wc -l "$file"
doneSELECT
p.title,
p.status,
COUNT(c.id) as comment_count
FROM posts p
LEFT JOIN comments c ON c.post_id = p.id
WHERE p.published_at > '2026-01-01'
GROUP BY p.id
ORDER BY comment_count DESC
LIMIT 10;(defun org-to-ghost (file)
"Export FILE to Ghost Lexical JSON."
(interactive "fOrg file: ")
(with-temp-buffer
(insert-file-contents file)
(org-mode)
(org-export-as 'lexical)))import sys
print(f"Python {sys.version}")
print("Hello from Python!")Python 3.12.0 (main, Oct 2 2024) Hello from Python!
echo "Current date: $(date)"
echo "User: $(whoami)"Current date: Wed Jan 29 11:45:00 EST 2026 User: hh
import json
config = {
"site": "ii.coop",
"theme": "casper",
"features": ["members", "newsletters", "comments"],
"settings": {
"posts_per_page": 10,
"navigation": [
{"label": "Home", "url": "/"},
{"label": "About", "url": "/about/"}
]
}
}
print(json.dumps(config, indent=2)){
"site": "ii.coop",
"theme": "casper",
"features": ["members", "newsletters", "comments"],
"settings": {
"posts_per_page": 10,
"navigation": [
{"label": "Home", "url": "/"},
{"label": "About", "url": "/about/"}
]
}
}tables = ['users', 'posts', 'comments']
for table in tables:
print(f"SELECT * FROM {table} LIMIT 5;")SELECT * FROM users LIMIT 5;
SELECT * FROM posts LIMIT 5;
SELECT * FROM comments LIMIT 5;"#+BEGIN_SRC yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: ghost-config
data:
url: https://ii.coop
mail__transport: SMTPapiVersion: v1
kind: ConfigMap
metadata:
name: ghost-config
data:
url: https://ii.coop
mail__transport: SMTP# Simulate fetching data
data = [
{"id": 1, "name": "Alice", "role": "admin"},
{"id": 2, "name": "Bob", "role": "editor"},
{"id": 3, "name": "Carol", "role": "author"}
]
import json
print(json.dumps(data))[{"id": 1, "name": "Alice", "role": "admin"}, {"id": 2, "name": "Bob", "role": "editor"}, {"id": 3, "name": "Carol", "role": "author"}]
echo '[{"id": 1, "name": "Alice", "role": "admin"}, {"id": 2, "name": "Bob", "role": "editor"}]' | \
jq '.[] | "User: \(.name) (\(.role))"'"User: Alice (admin)" "User: Bob (editor)"
import yaml
config = {
'users': [
{'name': 'Alice', 'permissions': ['read', 'write', 'admin']},
{'name': 'Bob', 'permissions': ['read', 'write']}
]
}
print(yaml.dump(config, default_flow_style=False))users:
- name: Alice
permissions:
- read
- write
- admin
- name: Bob
permissions:
- read
- writeHere’s how you might use kubectl to check pods:
kubectl get pods -n ghostThe output would look like:
NAME READY STATUS RESTARTS AGE ghost-6d4f5b7c8-abc12 1/1 Running 0 2d ghost-6d4f5b7c8-def34 1/1 Running 0 2d mysql-7f8d9c6b5-xyz99 1/1 Running 0 5d
This document demonstrates:
- Simple code blocks in multiple languages
- Code with text output (
:exports both) - Code generating other code formats (JSON, SQL, YAML)
- Multi-step pipelines with different languages
- Example blocks for sample output