Last active
March 10, 2019 18:24
-
-
Save stathissideris/89e53fe35d8603d98693cd729ec26b7a to your computer and use it in GitHub Desktop.
pastebox for Clojure
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
;; 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