Skip to content

Instantly share code, notes, and snippets.

View lxdlam's full-sized avatar
🔍
Exploring

lxdlam lxdlam

🔍
Exploring
View GitHub Profile
@lxdlam
lxdlam / README.md
Created April 5, 2026 14:17 — forked from Artefact2/README.md
GGUF quantizations overview
@lxdlam
lxdlam / README.md
Created April 1, 2026 21:11 — forked from emschwartz/README.md
The Most Popular Blogs of Hacker News in 2025

This is an OPML version of the HN Popularity Contest results for 2025, for importing into RSS feed readers.

Plug: if you want to find content related to your interests from thousands of obscure blogs and noisy sources like HN Newest, check out Scour. It's a free, personalized content feed I work on where you define your interests in your own words and it ranks content based on how closely related it is to those topics.

(** ---------- ACL phantom tags (no runtime values) ---------- *)
type readonly (* no constructors – a compile-time marker *)
type readwrite (* idem *)
(** ---------- Generic driver ---------- *)
type _ driver = { mutable value : int } (* 'acl is phantom *)
(** Universally available *)
let read (d : _ driver) = d.value
package main
import "fmt"
type readonly struct{}
type readwrite struct{}
type dbAcl interface{ readonly | readwrite }
type Driver[acl dbAcl] struct {
@lxdlam
lxdlam / guide.md
Created January 10, 2025 09:51
golang mTLS + step-ca example
  1. Bootstrap a local smallstep CA following the guide. Remember to start your CA server.
  2. Issue certificates:
    • Download Root ca: step ca root ca.crt
    • Issue server cert: step ca certificate "mtls.internal" server.crt server.key
    • Issue client cert: step ca certificate "mtls.internal" client.crt client.key
  3. Start the server at the same directory or modify the code to locate the cert files. If you issued the certs like my setup, remember to add the domain mtls.internal in your hosts or so on.
  4. Test with TestClient or test with curl: curl -vvvv https://mtls.internal:8080 --cacert ca.crt --cert client.crt --key client.key.
from pydantic import BaseModel, Field, RootModel, Discriminator, Tag
from typing import Literal, TypeVar, Generic, Annotated, Any
_ResponseType = TypeVar("_ResponseType")
def get_discriminator_value(v: Any) -> str:
if isinstance(v, dict):
return "success" if v.get("code") == 0 else "error"
return "success" if getattr(v, "code") == 0 else "error"
from os import walk
from urllib.parse import urlparse
from playwright.sync_api import sync_playwright
from time import sleep
TEMPLATE = "https://drive.usercontent.google.com/download?id={share_id}&export=download"
if __name__ == "__main__":
with sync_playwright() as p:

$argon2id$v=19$m=512,t=256,p=1$n6yvzJe2AxOS6yQBsCPKKA$Ei089XHiQ+u6SDk9DmyzLOzr7qccHmzJ88uK3eKg2dQ

@lxdlam
lxdlam / links.md
Created March 7, 2024 06:02 — forked from Leandros/links.md
Writing a Modern Rendering Engine