Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View DeedleFake's full-sized avatar

DeedleFake

View GitHub Profile
@DeedleFake
DeedleFake / README.md
Created April 18, 2024 21:51
Docker Configuration for Running Livebook in a Container with Tailscale as the Identity Provider

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.

@DeedleFake
DeedleFake / README.md
Last active February 8, 2024 20:02
Livebook Setup with livebook:// URL Support on Linux

A Quick Guide to Setting up Livebook with Support for livebook:// URLs on Linux

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.

  1. Run docker volume create livebook-data and docker volume create livebook-config.
  2. Place the livebook.service file in $HOME/.config/systemd/user.
  3. Run systemctl --user enable --now livebook.service.
  4. Place the dev.livebook.Livebook.desktop file in $HOME/.local/share/applications.
  5. Place the dev.livebook.Livebook.svg file in $HOME/.local/share/icons/hicolor/scalable/apps.
@DeedleFake
DeedleFake / README.md
Created December 12, 2023 19:43
Go/Elixir NIF Experiment

Go/Elixir NIF Experiment

This was a quick little experiment to try to call Go code from Elixir. To try it out, simply run

$ go build -buildmode=c-shared -o nif-test.so
$ iex test.exs
@DeedleFake
DeedleFake / example.go
Created November 22, 2023 17:18
Templ and Formam handler creation function.
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)
@DeedleFake
DeedleFake / README.md
Created October 20, 2023 04:09
Tailscale Peer Info

This is a quick little program that gathers some info about Tailscale peers that isn't readily available from the usual CLI tools.

@DeedleFake
DeedleFake / example.go
Last active September 7, 2023 19:45
An example of a very, very basic structure for a simple REST API in Go.
package main
import (
"context"
"database/sql"
"fmt"
"log/slog"
"net"
"net/http"
"os"
@DeedleFake
DeedleFake / go.mod
Last active August 24, 2023 04:13
More iterator and pipe operator experimentation.
module test
go 1.22
@DeedleFake
DeedleFake / README.md
Created August 22, 2023 22:54
Go iterators using Elixir pipe operator.
@DeedleFake
DeedleFake / advent04.go
Created August 2, 2023 00:39
Advent of Code, 2022, Day 4
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
"strings"
)
@DeedleFake
DeedleFake / go.mod
Last active July 31, 2023 19:02
A simple attempt at implementing iterators using golang/go#61405.
module test
go 1.21