Code Syntax Highlighting Test
This post exists to verify that code blocks render correctly with the Everforest theme and FiraCode Nerd Font.
TypeScript
interface User {
id: string;
email: string;
createdAt: Date;
}
async function fetchUser(id: string): Promise<User | null> {
const res = await fetch(`/api/users/${id}`);
if (!res.ok) return null;
return res.json() as Promise<User>;
}
// Arrow function with generics
const identity = <T>(value: T): T => value;
// Optional chaining + nullish coalescing
const name = user?.profile?.displayName ?? "Anonymous";Rust
use std::collections::HashMap;
fn word_count(text: &str) -> HashMap<&str, usize> {
let mut counts = HashMap::new();
for word in text.split_whitespace() {
*counts.entry(word).or_insert(0) += 1;
}
counts
}
fn main() {
let text = "hello world hello rust";
let counts = word_count(text);
for (word, count) in &counts {
println!("{word}: {count}");
}
}Shell / Bash
#!/usr/bin/env bash
set -euo pipefail
DB_URL="${DATABASE_URL:-postgres://localhost/mydb}"
echo "Running migrations against: $DB_URL"
pnpm drizzle-kit migrate
if [ $? -eq 0 ]; then
echo "✅ Migrations complete"
else
echo "❌ Migration failed" >&2
exit 1
fiJSON
{
"name": "homebase",
"version": "0.1.0",
"scripts": {
"dev": "next dev -p 3001",
"build": "next build",
"db:seed": "node --env-file=.env --experimental-strip-types db/seed.ts"
},
"dependencies": {
"next": "^16.0.0",
"react": "^19.0.0"
}
}Inline Code
Use const by default and only reach for let when reassignment is genuinely needed. The ??= operator is your friend for lazy initialization.
Ligature test: =>, !=, ===, !==, <=, >=, ->, <-, ::=, |>