Skip to content

Instantly share code, notes, and snippets.

View dom_stuff.cljs
(ns interaction.dom-stuff
(:require [plas.thicc :as thicc]))
(def state (atom {:count 1}))
;; (conj! (thicc/el-by-id "app")
;; (thicc/dom [:<>
;; [:h1 "Count is " (thicc/reatom :count state)]
;; [:button {:on-click #(swap! state update :count inc)} "+1"]]))
View sci_test.html
<!DOCTYPE html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no">
<script type="application/clojurescript">
(defn loop [frame-time]
(js/requestAnimationFrame loop)
(run! (fn [i]
View 03_user_config.el
;;; -*- lexical-binding: t -*-
;; (when (not (server-running-p))
;; (server-start))
;; Enable copy-paste to/from x clipboard when running in a terminal
(set-frame-font "Iosevka Fixed SS14-22")
(global-linum-mode 1)
plexus / lookup.clj
Created Mar 12, 2021
Doing key lookup in Clojure
View lookup.clj
;; If it's a record-like thing then we want to emphasize
;; that it's a key-lookup, so use (:key coll)
(:uri req)
(:email member)
;; Some collections behave more like functions, here use (coll key),
;; that way someone reading the code without context can understand it,
;; without having to know that it's really a map or set
(def allowed-role? #{:admin :mod})
View about_support.raw
"application": {
"name": "Firefox",
"osVersion": "Linux 5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021",
"version": "88.0a1",
"buildID": "20210303215027",
"distributionID": "",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0",
"safeMode": false,
"updateChannel": "nightly",
View bar.clj
(defn add-numbers [& numbers]
(apply + numbers))
View bar.clj
(defn add-numbers [& numbers]
(apply + numbers))
View puget.css
/* Styling for Puget :html-classes / lambdaisland/deep-diff2 */
code .class-delimiter { color: #a3685a;}
code .class-name { color: #a3685a;}
code .nil { color: #4d4d4c;}
code .boolean { color: #4d4d4c;}
code .number { color: #4271ae;}
code .character { color: #a3685a;}
code .string { color: #3e999f;}
code .keyword { color: #4271ae;}
View defwrapper.clj
(ns defwrapper
(:require [clojure.string :as str]))
(set! *warn-on-reflection* true)
(defn class-methods [^Class class]
(seq (.getMethods class)))
(defn constructors [^Class klazz]
(.getDeclaredConstructors klazz))
View message.json
"text": "Thanks to <@U0525KG62> I was able to create my own very non-scientifiy graphs on our counties covid-19 cases 7 daysrolloing average development. This “just a bunch” of statements put together in a repl.",
"files": [
"id": "F01E5SET7RV",
"created": 1605191147,
"timestamp": 1605191147,
"name": "image.png",
"title": "image.png",
"mimetype": "image/png",