Fork me on GitHub

;; 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