Skip to content

Instantly share code, notes, and snippets.

// a simple widget for positioning HTML popovers using a vendored floating ui (because I can't use css anchor positioning yet)
const { computePosition, flip } = window.FloatingUIDOM;
export function ActionMenuPopover(container) {
const trigger = container.querySelector("[popovertarget]");
const popover = container.querySelector("[popover]");
const update = () => {
computePosition(trigger, popover, {
placement: "bottom",
middleware: [flip()],
@Ramblurr
Ramblurr / tab_state.clj
Created April 10, 2025 11:18
a quicky example of per-tab session state with datastar when using hyperlith style page rendering
;; a quicky example of per-tab session state with datastar
;; when using hyperlith style page rendering
(:require
[clojure.core.async :as a]
[chime.core :as chime])
(def !page-state (atom {}))
@HassanYA
HassanYA / middlewares.clj
Last active April 8, 2025 11:43
short-sse middleware for clojure datastar sdk httpkit
(require '[starfederation.datastar.clojure.adapter.http-kit :as hk-gen])
(defn short-sse
[handler]
(fn [request]
(let [hooks (handler request)
on-init (:init hooks)
on-open (:open hooks)
on-close (:close hooks)
init-results (when on-init (on-init))]
@awwx
awwx / main.cljc
Last active March 28, 2024 10:25
Electric without atoms
(ns main
(:require
[missionary.core :as m]
[hyperfiddle.electric :as e]
[hyperfiddle.electric-dom2 :as dom])
#?(:cljs
(:require-macros [main])))
;; event emitter with only one subscriber
@dustingetz
dustingetz / electric-references.md
Last active June 5, 2025 13:07
Reference list — Electric Clojure

References — Electric Clojure

Electric Clojure implements a form of arrowized continuous time dataflow programming with extensions for network-transparent function composition.

@dustingetz
dustingetz / missionary-concept-map.md
Last active June 5, 2025 13:28
Missionary concept map

Missionary concept map

Missionary primitives fit into three categories:

Effect descriptions = pure functional programming which is about trees not graphs

  • continuous flow, m/?< (switch)
  • m/watch, m/latest, m/cp
  • m/observe
  • m/reductions, m/relieve
@ssrihari
ssrihari / clojure-learning-list.md
Last active June 12, 2025 08:03
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@malcolmsparks
malcolmsparks / thoughts-on-yada.adoc
Last active January 22, 2023 19:24
Thoughts on yada

Thoughts on yada

Frameworks

Let’s define a framework as any library that contains one or more functions that accept callbacks.

Web frameworks are great for beginner developers who need to get stuff done. But they ultimately force you into a corner. In most applications, experienced developers need to retain control. Libraries are better.

(ns dustin.y2021.missionary_promise
(:require [hyperfiddle.rcf :as rcf :refer [tests % !]]
[missionary.core :as m]))
; We want to turn a promise-thing into a Task
; Leo: The problem with Promise and CompletableFuture is no cancellation
; What task do we want? Is the task listening to the promise? Or is the task the process backing the promise?
; Background: when you get a promise, there is a process in the background which eventually completes the promise.
; Do you want to await the result of an already running promise
; or do you want to run the process of the promise when the task is run?
(ns scratch)
(defn map [f]
(fn [xf]
(fn
([] (xf))
([acc] (xf acc))
([acc itm]
(xf acc (f itm))))))