Skip to content

Instantly share code, notes, and snippets.

@abihf
abihf / 1brc.go
Created March 16, 2024 20:58
Golang Implementation for 1 Billion Rows Challange
package main
import (
"bufio"
"bytes"
"errors"
"fmt"
"hash/maphash"
"io"
"os"
@abihf
abihf / onejavdl.go
Created July 6, 2024 19:36
Download latest torrents from onejav
package main
import (
"context"
"fmt"
"io"
"log/slog"
"net/http"
"os"
"path/filepath"
@abihf
abihf / xdg-open
Created December 11, 2025 03:08
xdg-open using handler and app2unit
#!/bin/sh
url="${1}"
mime="$(handlr mime --json "${url}" | jq -r '.[0].mime')"
handler="$(handlr get --json "${mime}" | jq -r '.handler')"
exec app2unit "${handler}" "${url}"