CAD03 is the binary data format underlying the lattice of Convex. This a first version of a partial decoder in Clojure and Javascript (via Squint)
More information on the format here https://docs.convex.world/docs/cad/encoding
CAD03 is the binary data format underlying the lattice of Convex. This a first version of a partial decoder in Clojure and Javascript (via Squint)
More information on the format here https://docs.convex.world/docs/cad/encoding
| ;; Follow up of https://gist.github.com/jeroenvandijk/cb5f3411943c24dc68b225f34a3e474b | |
| ;; | |
| ;; Now trying to use reitit.openapi still some work in muuntaja.format.json or maybe the json part can be done differently | |
| ;; | |
| ;; Run this script with `bb bb_reitit_demo_openapi.clj` and visit http://localhost:3000/openapi.json | |
| (require '[babashka.deps :as deps]) | |
| (deps/add-deps '{:deps {metosin/reitit {:mvn/version "0.9.2"}}}) |
| ;; TODO create a PR to Reitit to add some `:bb` conditionals | |
| ;; | |
| ;; Run this script with `bb reitit_demo.clj` and visit http://localhost:3000 | |
| (require '[babashka.deps :as deps]) | |
| (deps/add-deps '{:deps {metosin/reitit {:mvn/version "0.9.2"}}}) | |
| ;; --- START Reitit monkey patch |
| (defn get-free-port [] | |
| (with-open [socket (java.net.ServerSocket. 0)] | |
| (.getLocalPort socket))) |
| (ns malli.inline-output | |
| (:require | |
| [edamame.core :refer [parse-string]] | |
| [malli.core :as m] | |
| [malli.error :as me])) | |
| ;; -- helper code to find location data in an edn file | |
| (defprotocol IUnwrap | |
| (unwrap [_])) |
| ;; When middleware comes with a certain dependency order things get a bit tedious and error prone. | |
| ;; Consider example 1 below: | |
| (defn add-cmd [req cmd] | |
| (update req :cmd (fnil conj []) cmd)) | |
| (defn add-cmd-handler [cmd] | |
| (fn [req] |
| ;; Copy of https://gist.github.com/alandipert/1263783 | |
| ;; | |
| ;; Copyright (c) Alan Dipert. All rights reserved. | |
| ;; The use and distribution terms for this software are covered by the | |
| ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
| ;; By using this software in any fashion, you are agreeing to be bound by | |
| ;; the terms of this license. | |
| ;; You must not remove this notice, or any other, from this software. | |
| (ns alandipert.kahn |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" | |
| "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.plex.pms</string> | |
| <key>OnDemand</key> | |
| <false/> | |
| <key>ProgramArguments</key> |
| {:name "Search the Clojurians Slack-archive" | |
| :author "Gert Goet" | |
| :license "MIT"} | |
| ;;--- | |
| (when-some [q (js/prompt "Search the Clojurians Slack-archive:")] | |
| (.open js/window (str "https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/search/" q))) |
| #!/usr/bin/env bb | |
| (doseq [line (->> (file-seq (clojure.java.io/file (System/getenv "PWD"))) | |
| (filter #(.isFile %)) | |
| (filter (fn [f] (contains? #{"clj" "cljc" "cljs" "bb"} | |
| (last (clojure.string/split (.getName f) #"\."))))) | |
| (mapcat #(clojure.string/split-lines (slurp %))) | |
| sort | |
| )] | |
| (println line)) |