Fork me on GitHub
#off-topic
<
2022-12-28
>
bherrmann13:12:12

;; a clojure function to copy a string to the system clipboard .
;; handy when using the repl to transform some data and paste it somewhere else.
(defn to-clip [ s ]
  (let [
        string-selection (java.awt.datatransfer.StringSelection. s)
        clipboard (.. (java.awt.Toolkit/getDefaultToolkit) (getSystemClipboard))
        ]
    (.setContents clipboard string-selection nil)))

🆒 17
Lennart Buit16:12:55

Triple backticks gives you code blocks on slack, e.g.

` some piece of code with newlines 
`. Or just use the wysiwyg buttons

👍 1