I had a very specific configuration I was trying to get working for personal usage. After a bunch of running in circles, this was the result. I figured I'd stick it somewhere public in case anyone else finds it useful.
Note that the following steps are intended as a rough outline. They are exact steps to replicate my setup, but your setup might differ depending on, for example, using an init system other than systemd or various other factors. Adjust as necessary.
- Run
docker volume create livebook-data
anddocker volume create livebook-config
. - Place the
livebook.service
file in$HOME/.config/systemd/user
. - Run
systemctl --user enable --now livebook.service
. - Place the
dev.livebook.Livebook.desktop
file in$HOME/.local/share/applications
. - Place the
dev.livebook.Livebook.svg
file in$HOME/.local/share/icons/hicolor/scalable/apps
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func FormHandler[T any](f func(T) templ.Component) http.Handler { | |
return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { | |
req.ParseForm() | |
var data T | |
d := formam.NewDecoder(nil) | |
d.Decode(req.Form, &data) | |
// TODO: Handle errors. | |
templ.Handler(f(data)).ServeHTTP(rw, req) |
This is a quick little program that gathers some info about Tailscale peers that isn't readily available from the usual CLI tools.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"database/sql" | |
"fmt" | |
"log/slog" | |
"net" | |
"net/http" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module test | |
go 1.22 |
To try this code, you can use the modified Go toolchain found at https://github.com/DeedleFake/go/tree/pipe-operator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"os" | |
"strconv" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module test | |
go 1.21 |
NewerOlder