Skip to content

Instantly share code, notes, and snippets.

@hindol
hindol / bag.clj
Last active March 13, 2020 11:27
Bag / MultiSet in Clojure (How to create a custom collection in Clojure)
(ns com.github.hindol.euler.collections
(:import
(clojure.lang IPersistentCollection
IPersistentSet
Seqable)))
(deftype Bag [^clojure.lang.IPersistentMap m
^long n]
IPersistentSet
(get [this k]
@thomasdarimont
thomasdarimont / index.html
Last active April 8, 2024 14:10
Mini SPA with Keycloak.js with support for PKCE and RAR
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Keycloak SPA Demo</title>
<style>
body {
@ynonp
ynonp / clojurescript-useeffect.cljs
Created February 18, 2022 18:42
ClojureScript useEffect example
(ns reagent-useeffect-demo.core
(:require
[reagent.core :as r]
[react :as react]
[cljs.core.async :refer [go]]
[cljs.core.async.interop :refer-macros [<p!]]
[reagent.dom :as rdom]))
(defn use-pokemon [id]
(let [[data set-data] (react/useState {})