View mix.clj
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
(defn mix* | |
"Helper function for mix." | |
{:private true} | |
[colls] | |
(if (seq colls) | |
(if (seq (first colls)) | |
(lazy-seq (cons (ffirst colls) | |
(mix* (conj (subvec colls 1) | |
(rest (first colls)))))) | |
(recur (subvec colls 1))) |
View profile_clj_to_deps_edn.clj
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 '[meander.epsilon :as m]) | |
(m/rewrite (read-string (slurp "project.clj")) | |
(defproject _ _ . !key !value ...) | |
(m/cata [:DEPS_EDN (m/map-of !key !value)]) | |
[:DEPS_EDN {:dependencies ?dependencies | |
:profiles ?profiles | |
:source-paths !paths | |
:resource-paths !paths}] |
View deps.edn
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 ["src"] | |
:deps {org.clojure/clojure {:mvn/version "1.10.0"} | |
org.clojure/clojurescript {:mvn/version "1.10.439"} | |
org.clojure/test.check {:mvn/version "0.10.0-alpha3"} | |
com.google/clojure-turtle {:mvn/version "0.3.0"} | |
meander/delta {:mvn/version "0.0.85"} | |
quil/quil {:mvn/version "3.0.0"}} | |
:aliases {:test {:extra-paths ["test"] | |
:extra-deps {org.clojure/test.check {:mvn/version "0.10.0-alpha3"} | |
com.cognitect/test-runner {:git/url "https://github.com/healthfinch/test-runner" |
View meander_delta_interpreter.clj
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 meander.interpret.delta | |
(:require [meander.match.delta :as r.match] | |
[meander.syntax.delta :as r.syntax] | |
[meander.util.delta :as r.util])) | |
(defn genmut | |
[] | |
{:tag :mut | |
:symbol (gensym "*m__")}) |
View k-combinations.clj
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
(defn swap | |
"Swap the elements at positions `i` and `j` in `v`." | |
{:private true} | |
[v i j] | |
(-> v | |
(assoc i (nth v j)) | |
(assoc j (nth v i)))) | |
;; SEE: https://en.wikipedia.org/wiki/Heap%27s_algorithm | |
(defn permutations |
View aws-example.clj
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 scratch | |
(:require | |
[clojure.data.json :as json] | |
[clojure.string :as string] | |
[meander.strategy.alpha :as r] | |
[meander.match.alpha :as r.match])) | |
(def service-2-json | |
(json/read-str | |
(slurp "https://raw.githubusercontent.com/aws/aws-sdk-java-v2/master/services/batch/src/main/resources/codegen-resources/service-2.json"))) |
View sql_auto_shout.el
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
(defun ~/end-of-previous-face-change (face-name) | |
(save-excursion | |
(let ((continue t) | |
(answer nil)) | |
(while continue | |
(let ((p (or (previous-single-property-change (point) 'face) | |
1))) | |
(if (= p 1) | |
(progn | |
(setq continue nil) |
View derive_specs.clj
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 '[spec-provider.provider :as sp]) | |
(defn derive-specs [var & args] | |
(let [ns-sym (ns-name (:ns (meta var))) | |
ns-name (name ns-sym) | |
derived-specs (atom []) | |
fn-var-info (into [] (keep (fn [[var-sym var]] | |
(let [x (deref var)] | |
(when (fn? x) | |
[var var-sym x])))) |
View if_not.clj
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 if-not.bench | |
(:require [criterium.core])) | |
(defmacro if-not* | |
([test then] `(if ~test nil ~then)) | |
([test then else] | |
`(if ~test ~else ~then))) | |
(criterium.core/bench (if-not false 1 2)) | |
;; Evaluation count : 5375474880 in 60 samples of 89591248 calls. |
View example-out.txt
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
datomic.client.api | |
Synchronous client library for interacting with Datomic. | |
This namespace is a wrapper for datomic.client.api.async. | |
Functions in this namespace that communicate with a separate | |
process take an arg-map with the following optional keys: | |
:timeout Timeout in msec. |
NewerOlder