This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.string :as string]) | |
(def blink | |
(memoize | |
(fn [times n] | |
(if (zero? times) | |
1 | |
(let [l (count n) | |
l-half (bit-shift-right l 1) | |
even? (= (+ l-half l-half) l)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns omnitech.shims) | |
(defn- closest [selector] | |
(this-as node | |
(let [node-list (.querySelectorAll js/document selector) | |
all (mapv #(aget node-list %) (range 0 (.-length node-list)))] | |
(loop [node node] | |
(let [parent (.-parentNode node)] | |
(if (some #(= parent %) all) | |
parent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns user | |
(:require [clojure.core.async :as async])) | |
(defn now-millis [] | |
(System/currentTimeMillis)) | |
(defn throttled-chan | |
"Returns a channel that will throttle attempts to take items according to the rate-limits. | |
rate-limits should be a sequence of pairs of integers. The first item in each pair | |
is describing how many items is possible to take, at most, from the input for the interval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmulti foo (fn [x & _] x)) | |
(defmethod foo :sum [_ & args] (apply + args)) | |
(apply foo (list* :sum (range 10))) ;; => ok | |
(apply foo (list* :sum (range 25))) ;; => Invalid arity exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:paths ["."]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:deps {org.clojure/clojure {:mvn/version "1.10.1"}} | |
:paths ["."]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1+2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clj -Sdeps '{:deps {amazonica {:mvn/version "0.3.142" :exclusions [com.amazonaws/aws-java-sdk com.amazonaws/amazon-kinesis-client]} com.amazonaws/aws-java-sdk-s3 {:mvn/version "1.11.475"} com.amazonaws/aws-java-sdk-core {:mvn/version "1.11.475"}}}' -Stree | |
org.clojure/clojure 1.10.0 | |
org.clojure/core.specs.alpha 0.2.44 | |
org.clojure/spec.alpha 0.2.176 | |
org.clojure/tools.trace 0.7.10 | |
com.amazonaws/aws-java-sdk-core 1.11.475 | |
com.fasterxml.jackson.core/jackson-databind 2.6.7.2 | |
com.fasterxml.jackson.core/jackson-core 2.6.7 | |
com.fasterxml.jackson.core/jackson-annotations 2.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am delaguardo on github. | |
* I am delaguardo (https://keybase.io/delaguardo) on keybase. | |
* I have a public key ASCuGGRAQF2wfy-ooyMNloSDB33IEfsyI68GpEhU7tIpZAo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Enable ligatures without prettify-symbols | |
(provide 'add-pragmatapro-symbol-keywords) | |
(defconst pragmatapro-fontlock-keywords-alist | |
(mapcar (lambda (regex-char-pair) | |
`(,(car regex-char-pair) | |
(0 (prog1 () | |
(compose-region (match-beginning 1) | |
(match-end 1) |
NewerOlder