Skip to content

Instantly share code, notes, and snippets.

View eelkevanfoeken's full-sized avatar
💭
I may be slow to respond.

Eelke van Foeken eelkevanfoeken

💭
I may be slow to respond.
View GitHub Profile
@eelkevanfoeken
eelkevanfoeken / s3_bucket_remover.clj
Created October 21, 2021 14:11
A script to empty and delete buckets
#!/usr/bin/env bb
(require '[babashka.pods :as pods])
(pods/load-pod 'org.babashka/aws "0.0.6")
(require '[pod.babashka.aws :as aws])
(require '[pod.babashka.aws.credentials :as credentials])
(def region "us-east-1")
@eelkevanfoeken
eelkevanfoeken / vega-viz.json
Last active April 15, 2020 15:08
Vega/Vega-Lite viz; To load go to https://vega.github.io/editor
{"$schema":"https://vega.github.io/schema/vega-lite/v4.json","data":{"values":[{"okr":"OKR1","date":1585699200000,"complexity":"0.0"},{"okr":"OKR1","date":1585785600000,"complexity":"-0.1777777777777778"},{"okr":"OKR1","date":1585872000000,"complexity":"-0.3555555555555556"},{"okr":"OKR1","date":1585958400000,"complexity":"-0.5333333333333333"},{"okr":"OKR1","date":1586044800000,"complexity":"-0.7111111111111111"},{"okr":"OKR1","date":1586131200000,"complexity":"-0.888888888888889"},{"okr":"OKR1","date":1586217600000,"complexity":"-1.066666666666667"},{"okr":"OKR1","date":1586304000000,"complexity":"-1.244444444444444"},{"okr":"OKR1","date":1586390400000,"complexity":"-1.422222222222222"},{"okr":"OKR1","date":1586476800000,"complexity":"-1.6"},{"okr":"OKR1","date":1586563200000,"complexity":"-1.777777777777778"},{"okr":"OKR1","date":1586649600000,"complexity":"-1.955555555555556"},{"okr":"OKR1","date":1586736000000,"complexity":"-2.133333333333333"},{"okr":"OKR1","date":1586822400000,"complexity":"-2.31111111
@eelkevanfoeken
eelkevanfoeken / kondo_script.clj
Created January 6, 2020 09:47
This is a script for kondo linting in GitHub actions, is uses https://github.com/borkdude/babashka
#!/usr/bin/env bb
(let [{:keys [exit out]} (shell/sh "clojure" "-A:lint/kondo" "--lint" "src" "dev" "--config" "{:linters {:not-empty? {:level :off} :invalid-arity {:level :warning}}}")]
(println out)
(if (= exit 3)
(System/exit exit)
(System/exit 0)))
(defn double-sort-by [ks1 ks2 asc? xs]
(sort-by #(vector (get-in % ks1) (get-in % ks2))
(fn [[xv1 xv2] [yv1 yv2]]
(if asc?
(compare [xv1 xv2] [yv1 yv2])
(compare [yv1 xv2] [xv1 yv2])))
xs))