โ† Writing

Hello World

First post on the new MDX pipeline.

Testing the MDX pipeline. Math: E=mc2E = mc^2

๐ŸŽจ Code Blocks Showcase

go.mod
module github.com/amirifar/website
 
go 1.24
 
require (
    github.com/amirifar/utils v0.2.1
)
main.go
package main
 
import (
    "fmt"
    "os"
)
 
func main() {
    name := os.Getenv("USER")
    fmt.Printf("Hello, %s!\n", name)
}

Python โ€” list comprehension

utils.py
def process(items):
    evens = [x for x in items if x % 2 == 0]
    squared = [x ** 2 for x in items]
    return evens, squared
 
data = [1, 2, 3, 4, 5, 6]
result = process(data)
print(result)

JavaScript โ€” async / await

fetch.js
async function loadUser(id) {
    const url = `https://api.example.com/users/${id}`;
    const res = await fetch(url);
    if (!res.ok) throw new Error("fetch failed");
    return res.json();
}
 
loadUser(42).then(console.log).catch(console.error);

TypeScript โ€” generic

stack.ts
class Stack<T> {
    private items: T[] = [];
 
    push(item: T): void {
        this.items.push(item);
    }
 
    pop(): T | undefined {
        return this.items.pop();
    }
}

Rust โ€” without extras

fn main() {
    let nums = vec![1, 2, 3, 4, 5];
    let sum: i32 = nums.iter().sum();
    println!("Sum: {}", sum);
}

Plain block โ€” comparison

$ curl -s https://api.example.com/v1/health | jq '.status'

Inline code like navigator.clipboard.writeText() or os.Getenv("HOME") blends into the prose.