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
(ns simple-modular-ring.core | |
(require | |
[ring.adapter.jetty :refer [run-jetty]] | |
[simple-modular-ring.handler :as h] | |
[simple-modular-ring.middleware :as m] | |
)) | |
(def app | |
(-> h/post-form | |
m/logger |
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
(ns ring-with-routing.core | |
(require | |
[ring.adapter.jetty :refer [run-jetty]] | |
[ring-with-routing.handler :as h] | |
[ring-with-routing.middleware :as m] | |
)) | |
(def app | |
(-> h/handler-with-routing | |
m/logger |
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
(ns min-cljsbuild.core) | |
(js/alert "Hello ClojureScript!") |
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
(ns try-cljsbuild.core) | |
(js/alert "Hello Clojurescript!") |
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
(ns min-figwheel.core) | |
(js/alert "Hello ClojureScript!") |
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
(ns clicker.core | |
(:require [reagent.core :as r])) | |
(defn clicker [] | |
(let [john? (r/atom true)] | |
(fn [] | |
(let [clicks (r/atom 0)] | |
(fn [] | |
[:div | |
[:h1 {:on-click #(swap! john? not)} (if @john? "John" "James")] |
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
(ns clicker2.core | |
(:require [reagent.core :as r])) | |
(def message (r/atom "Hello")) | |
(defn clicker [some-message] | |
(let [john? (r/atom true)] | |
(fn [some-message] | |
(let [clicks (r/atom 0)] | |
(fn [some-message] |
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
(ns react-tutorial.core | |
(:require | |
[reagent.core :as r])) | |
(defn calculateWinner [squares] | |
(let [lines [[0 1 2] | |
[3 4 5] | |
[6 7 8] | |
[0 3 6] |
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
(ns react-tutorial.core | |
(:require | |
[reagent.core :as r])) | |
(defn Square [] | |
[:button.square]) | |
(defn Board [] | |
(let [renderSquare (fn [i] [Square]) | |
status (r/atom "Next player: X")] |
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
(defn Board [squares click-fn] | |
(let [renderSquare (fn [i] | |
[Square (get squares i) #(click-fn i)])] | |
[:div | |
[:div.board-row | |
[renderSquare 0] | |
[renderSquare 1] | |
[renderSquare 2]] | |
[:div.board-row | |
[renderSquare 3] |