Skip to content

Instantly share code, notes, and snippets.

@gmr458
gmr458 / example.md
Created January 29, 2026 04:14
Hono + TypeScript

Here's how I get the authenticated user with type safety using Hono and BetterAuth.

Here's the middleware. Using c.set(), I save the user and session in the current request:

import { createMiddleware } from "hono/factory";
import { auth } from "#app/lib/auth";

export const loggedInRequired = createMiddleware<{
    Variables: {
@gmr458
gmr458 / java.lua
Created March 4, 2025 01:34
Simple config for nvim-jdtls on Windows
-- this file should be located inside C:\Users\<YOUR-USER>\AppData\Local\nvim\ftplugin
-- i use mason to install jdtls, is easier for
-- me to use mason than download, extract
-- a put jdtls somewhere in my file system
-- mason provides a function to get the path of the
-- language server you installed with mason itself
--
-- on windows is something like this: