Skip to content

Instantly share code, notes, and snippets.

View Kah0ona's full-sized avatar

Marten Sytema Kah0ona

View GitHub Profile
(ns user
(:require [clojure.string :as string]))
(defn ⁵
"Returns n to the fifth power.
Note we use the UTF-character of superscript-5 as function name, because we can. ;-)"
[n]
(let [sq (* n n)]
(* sq sq n)))
@Kah0ona
Kah0ona / fails.clj
Created March 9, 2021 08:42
catching asserts inside a future body fails silently, but why?
(future
(try
(println "inside future body")
(assert false) ;;
(catch Exception e
(println "error" (.getMessage e))))) ;; no error printed
(try ;; not in a future, but just normal
(println "inside future body")
@Kah0ona
Kah0ona / uppy.cljs
Created December 9, 2021 19:08
Uppy example in clojurescript
(ns my.namespace.uppy
(:require [re-frame.core :as rf]
[reagent.core :as r]
[cs2.handlers :refer [debug-panel]]
[cs2.i18n :refer [tr]]
[clojure.string :as string]
[cs2.util :as util]
[cs2.components.widgets.modal :as modal]
[taoensso.timbre :refer [debug info error fatal warn]]))