This file contains hidden or 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
| #!/usr/bin/env bb | |
| (require '[babashka.pods :as pods]) | |
| (pods/load-pod 'org.babashka/aws "0.0.1") | |
| (require '[pod.babashka.aws :as aws]) | |
| (require '[clojure.tools.cli :refer [parse-opts]]) | |
This file contains hidden or 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
| (defmulti elementText (fn [element] (.-nodeType element))) | |
| (defmethod elementText :default | |
| [element] | |
| (mapcat #(elementText %) element)) | |
| (defmethod elementText 1 | |
| [element] | |
| (.-textContent element)) | |
| (defmethod elementText 9 | |
| [element] | |
| (.-textContent element)) |
This file contains hidden or 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
| ;; modeled on jQuery's .val() | |
| ;; the elementText and elementValue multi-methods work together to return a single item when the select is used as a select-one, | |
| ;; but return a collection of values when used with a multiple select. | |
| (defmulti elementText (fn [element] (.-nodeType element))) | |
| (defmethod elementText :default | |
| [element] | |
| (mapcat #(elementText %) element)) | |
| (defmethod elementText 1 | |
| [element] |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
| <style> | |
| .chart div { | |
| font: 10px sans-serif; | |
| background-color: steelblue; | |
| text-align: right; | |
| padding: 3px; | |
| margin: 1px; |