View har-specter.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
;; gorilla-repl.fileformat = 1 | |
;; ** | |
;;; # Play Data | |
;; ** | |
;; @@ | |
(ns play-data | |
(:require [gorilla-plot.core :as plot] | |
[gorilla-repl.table :refer [table-view]] |
View process-chrome-har-specter.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
(defmacro collect-all [collections] | |
(into [] (concat ['ALL] (for [c collections] | |
(if (and (sequential? c) (keyword? (first c))) | |
`(~'collect-one ~@c) | |
`(~'collect-one ~c)))))) | |
(defn process-har [requests & {:keys [view-with selection] :or {view-with count selection [ALL]}}] | |
(->> (select-one [:log :entries] requests) | |
(select [ALL (selected? :request :url sz-api?)]) | |
(transform [ALL :request :url] sz-api!) |
View braveclojure-ch5.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
;; gorilla-repl.fileformat = 1 | |
;; ** | |
;;; # Clojure for Brave and True | |
;;; | |
;;; ## CH5 Exercises | |
;; ** | |
;; @@ | |
(ns braveclojure-ch5) |
View restbot-elasticsearch-ttl.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
;;;;;;;;;;;;;;;;;;;; | |
;; MAPPINGs | |
;;;;;;;;;;;;;;;;;;;; | |
(def mapping-log | |
{:log {:_ttl {:enabled true | |
:default "2h"} | |
:_timestamp {:enabled true | |
:path "log_time"} | |
:properties {:log_time {:type "date"} |
View gist:611e5ec176d53b01e18e
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
(defprotocol ApiBuilder | |
(-req [this apiOpts])) | |
(defn- replace-with-param | |
[basestr param] | |
(clojure.string/replace basestr | |
(re-pattern (str "\\{" (name (first param)) "\\}")) | |
(str (second param)))) | |
(defn apply-api-params |
View gist:b6e7ca706a0f37a53031
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
(use 'plumbing.core) | |
(require '[plumbing.graph :as graph]) | |
(use '[restbot core utils]) | |
(defn- make-task-graph | |
[specs serverSym authSym] | |
(reduce merge | |
(for [[specKey specParam specBody] (partition 3 specs)] | |
{specKey (cons 'fnk | |
(list (conj specParam serverSym authSym) |