Skip to content

Instantly share code, notes, and snippets.

View sb8244's full-sized avatar

Stephen Bussey sb8244

View GitHub Profile
public class ImmutableCounter {
private final int counter;
public ImmutableCounter(int num) {
this.counter = num;
}
public int getCount() {
return this.counter;
}
import React, { useEffect, useRef, useState } from "react"
import { createReactBlockSpec } from "@blocknote/react"
import { SuperedBlockNoteEditor } from "../../BlockNoteEditor"
import useReload from "../../../useReload"
export const TABLE_OF_CONTENTS_TYPE = "table-of-contents"
interface Heading {
id: string
level: 1 | 2 | 3 | 4
defmodule SuperWeb.Plug.AssetNotFound do
import Plug.Conn
alias Plug.Conn
def init(opts) do
%{
at: Keyword.fetch!(opts, :at) |> Plug.Router.Utils.split(),
only: {Keyword.fetch!(opts, :only), []}
}
end
import { Plugin, PluginKey, Transaction } from "prosemirror-state"
import { BlockInfo, getBlockInfoFromPos } from "../helpers/getBlockInfoFromPos"
// ProseMirror Plugin which automatically assigns indices to ordered list items per nesting level.
const PLUGIN_KEY = new PluginKey(`numbered-list-indexing`)
interface Options {
getListCharacter?: (positionDetails: { depth: number; index: number }) => string
}
@sb8244
sb8244 / TLS.md
Created January 25, 2026 16:53
Setup TLS node networking on Fly.io

TLS is used for node-node communication. This is fairly tricky to setup with Erlang distribution because you have to generate a full CA and keys for it.

The following script is specific to Fly.io, because it generates a CACert for *.internal domains.

cd rel/overlays/tls
rm -f *.{pem,srl,conf}

# Generate the certificate authority