• Clojure
  • 16 lines
  • 123 views
  • 3 forks
  • Pasted by anonymous on October 12, 2013
(ns example.hello
  (:require
   [goog.string :as gstring]
   [goog.string.format]
   [goog.dom :as dom]
   [goog.dom.query :as query]))

(defn print-div [s]
  (when-let [nodelist (goog.dom.query "h1")]
    (let [out (aget nodelist 0)]
      (dom/append out (dom/createElement "br"))
      (dom/append out s))))

(defn ^:export say-hello []
  (print-div (gstring/toTitleCase "hi world"))
  (print-div (gstring/format "TEXT: %s" "hi")))

Did you know? CLOSE

  • There are keyboard shortcuts!
    • When Creating A Paste
      • ALT+P Toggle Private
      • CTRL+Enter Create Paste
      • ALT+W Toggle word wrap
    • When Viewing A Paste
      • ALT+G Go to a line
      • ALT+CTRL+E Edit the paste
      • ALT+R Show the raw code
  • There are URL options!
    • When Creating A Paste
      • ?lang=Javascript to default to javascript
    • When Viewing A Paste
      • #L-N Jump to line number N
?