Skip to content

Instantly share code, notes, and snippets.

@kurtharriger
kurtharriger / gist:7bd07ef03a9b28725f6f765f085455ac
Last active February 14, 2024 02:13
electric clojure server auth
#?(:cljs (def !client-jwt-token (atom nil)))
(def !user (atom nil))
(e/def user (e/watch !user))
(def ^:dynamic *user* nil)
(e/defn ProvideUserContext []
(e/client
(let [token (.getItem js/localStorage token-local-storage-key)]
(reset! !client-jwt-token token)))
{
"description": "Caps Lock to ESC on tap/Left Control on hold",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]