Skip to content

Instantly share code, notes, and snippets.

Avatar
👽

Thomas Crowley wavejumper

👽
View GitHub Profile
View error.cljs
(println "hello world")
(a-fn-that-does-not-exist)
@wavejumper
wavejumper / highlightjs.cljs
Created Oct 3, 2020
cljspad + highlight.js
View highlightjs.cljs
(require '[sandbox.reagent :as r :refer [render]])
(render [r/highlight {:language "clojure"} (pr-str {:a :b})])
@wavejumper
wavejumper / s3.cljs
Last active Oct 3, 2020
s3 cljspad example
View s3.cljs
(require '[sandbox.reagent :refer [render]]
'[cljs.tools.reader.edn :as edn])
(def s3-url
"https://s3.amazonaws.com/sandbox.cljsfiddle.net/1/cljspad.manifest.edn")
(defn massage-it [str]
(let [edn (edn/read-string str)]
(map :name (:sandbox/libraries edn))))
@wavejumper
wavejumper / datascript.cljs
Created Oct 3, 2020
cljspad + datascript
View datascript.cljs
(require '[datascript.core :as d])
;; Example from datascript README
;; https://github.com/tonsky/datascript
(def schema {:aka {:db/cardinality :db.cardinality/many}})
(def conn (d/create-conn schema))
(d/transact! conn [ { :db/id -1
@wavejumper
wavejumper / re-frame.cljs
Created Oct 3, 2020
cljspad re-frame demo
View re-frame.cljs
(require '[re-frame.core :as rf]
'[sandbox.reagent :refer [render]])
(rf/reg-sub :demo/counter
(fn [db _]
(:counter db)))
(rf/reg-event-db :demo/increment-counter
(fn [db _]
(update db :counter (fnil inc 0))))
@wavejumper
wavejumper / lorem.md
Last active Sep 27, 2020
cljsfiddle marked example
View lorem.md

Muneris chelydri nec ergo statione esset

Mea modo feris nil iamque ego navita

Lorem markdownum lusibus Amnis regia nuntia opus ad mittunt inpervius aequora nutricis! Parentis manus, geminas laborum Victoria Cephenum Dianae. Quis amoris.

Subduxit Aurora mensas finitque regit mihi nostri

View todo.cljs
(require '[reagent.core :as r]
'[reagent.dom :as rdom]
'[sandbox.reagent :refer [render]]
'[clojure.string :as str])
;; The todomvc found in https://github.com/reagent-project/reagent/tree/master/examples/todomvc
(inject-stylesheet "https://gist.githubusercontent.com/wavejumper/ef50850eceb027072fe7d5cbe598cf72/raw/913af47f4cbc63fea0acd382492314617edf35c7/todo.css")
(defonce todos (r/atom (sorted-map)))
View reagent.cljs
(require '[sandbox.reagent :refer [render]])
(defn my-component []
[:div {} "Hello from GitHub"])
(render [my-component])
View README.md