Hope you've had a solid week. Here's a quick roundup of what I've been building, reading, and thinking about.
Been heads-down on my personal site this week. The big additions:
Small things that quietly make the day-to-day a lot smoother.
Currently working through The Pragmatic Programmer again. This line keeps sticking with me:
"Don't live with broken windows. Fix bad designs, wrong decisions, and poor code when you see them."
It's the kind of advice that sounds obvious until you're staring at a six-month-old hack wondering why you left it there.
If you're building an admin panel with Next.js App Router, here's a simple two-layer CSRF defence that doesn't need tokens:
// 1. Custom header — can't be set cross-origin without a CORS preflight
if (req.headers.get("x-admin-request") !== "1") {
return NextResponse.json({ error: "Forbidden" }, { status: 403 });
}
// 2. Origin check — belt and braces
const origin = req.headers.get("origin");
if (origin && origin !== process.env.NEXT_PUBLIC_SITE_URL) {
return NextResponse.json({ error: "Forbidden" }, { status: 403 });
}
Pair it with SameSite=Lax session cookies and you're well covered.
That's all for this one. If anything resonated or you have questions, just reply — I read every message.
Until next week, Peery
Tech, code, business, finance, life — basically whatever's bouncing around in my head that might help someone else out. No fluff, no corporate speak, just real talk.