Skip to content

Instantly share code, notes, and snippets.

@velppa
Created February 8, 2021 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velppa/37b5a9e3ad800abff785e7de392718da to your computer and use it in GitHub Desktop.
Save velppa/37b5a9e3ad800abff785e7de392718da to your computer and use it in GitHub Desktop.
Various Babashka scripts

Various Babashka scripts

Each script is supposed to be runnable as bb -f filename.

aws_cognitect_sdk.clj
get latest version of Cognitect AWS SDK
(ns aws-cognitect-sdk
(:require [clojure.edn :as edn]
[org.httpkit.client :as http]))
(defn select-apis [apis data]
(let [keys (map #(->> % name (str "com.cognitect.aws/") keyword) apis)]
(select-keys data keys)))
(let [{:keys [body error]}
@(http/get "https://raw.githubusercontent.com/cognitect-labs/aws-api/master/latest-releases.edn")]
(->> (edn/read-string body)
seq
(map (fn [[k v]] [(keyword k) v]))
(into {})
(select-apis [:api :endpoints :s3 :dynamodb :sns :ssm])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment