Skip to content

Instantly share code, notes, and snippets.

View ptaoussanis's full-sized avatar
🦎
Hey! Hope you're having an awesome day :-)

Peter Taoussanis ptaoussanis

🦎
Hey! Hope you're having an awesome day :-)
View GitHub Profile
@ptaoussanis
ptaoussanis / sente-ring-jetty9-adapter-example.clj
Last active July 29, 2020 12:46
Example of how to use Sente and Jetty 9 via `ring-jetty9-adapter`
;; Please see https://gist.github.com/wavejumper/40c4cbb21d67e4415e20685710b68ea0
@ptaoussanis
ptaoussanis / stratch.clj
Last active December 9, 2021 18:08 — forked from danownsthisspace/stratch.clj
A function wrapper that ensures that a function can only be called once
(ns scratch.core
(:require [taoensso.encore :as enc]))
(defn wrap-once-in-a-while-1
"Uses atom + `swap-vals!`"
[^long msecs-period f]
(let [last-executed_ (atom 0)]
(fn wrapper [& args]
(let [[old new]