Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alandipert
Created May 20, 2016 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alandipert/1d6b10a4fb0457dd8855c819e13635c6 to your computer and use it in GitHub Desktop.
Save alandipert/1d6b10a4fb0457dd8855c819e13635c6 to your computer and use it in GitHub Desktop.
(page "index.html")
(defn process [in]
(apply str (reverse in)))
(def input-str (cell ""))
(def processed (cell= (process input-str)))
(html
(head
(link :href "app.css" :rel "stylesheet"))
(body
(h2 "input")
(let [working-input (cell "")]
(div
(textarea :keyup #(reset! working-input @%) :value working-input)
(br)
(button :click #(dosync
(reset! input-str @working-input)
(reset! working-input ""))
"Process")))
(h2 "output")
(textarea :disabled true processed)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment