Skip to content

Instantly share code, notes, and snippets.

@stathissideris
Last active March 10, 2019 18:24
Show Gist options
  • Save stathissideris/89e53fe35d8603d98693cd729ec26b7a to your computer and use it in GitHub Desktop.
Save stathissideris/89e53fe35d8603d98693cd729ec26b7a to your computer and use it in GitHub Desktop.
pastebox for Clojure
;; This will open a window with a single textfield where you can paste some HTML,
;; press <enter> and you should see a valid Clojure string get printed in your REPL,
;; without having to worry about escaping double quotes etc.
;; AND it fits a single tweet. :)
(import '[javax.swing JFrame JTextField]
'[java.awt.event ActionListener])
(doto (JFrame.)
(.add (doto (JTextField.)
(.addActionListener
(reify ActionListener
(actionPerformed [this e]
(prn (-> e .getSource .getText)))))))
(.pack)
(.setVisible true))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment