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
# Use an official, pre-rolled node image | |
# https://hub.docker.com/_/node/ | |
FROM node:7.8.0 | |
# Some variales which we can set when building the image... | |
ARG SRCDIR=src | |
RUN mkdir -p /opt/app | |
WORKDIR /opt/app |
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
>> l =[1,2,3,4,5,6,7,8,9] | |
>> list(zip(l, l[1:])) | |
[(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8), (8, 9)] |
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
(set-env! | |
:resource-paths #{"src/cljc" "src/clj" "src/cljs"} | |
:source-paths #{"test"} | |
:dependencies '[[org.clojure/clojure "1.9.0-alpha14" :scope "provided"] | |
[org.clojure/clojurescript "1.9.227" :scope "provided"] | |
[onetom/boot-lein-generate "0.1.3" :scope "test"] | |
[adzerk/boot-test "1.1.2" :scope "test"] | |
[crisptrutski/boot-cljs-test "0.2.1" :scope "test"] | |
[org.clojure/test.check "0.9.0" :scope "test"]] | |
:repositories |
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
For example, here's the excerpt of `cljs-repl`: | |
``` | |
(b/deftask cljs-repl | |
"Start a ClojureScript REPL server. | |
The default configuration starts a websocket server on a random available | |
port on localhost." | |
[b ids BUILD_IDS #{str} "Only inject reloading into these builds (= .cljs.edn files)" | |
i ip ADDR str "The IP address for the server to listen on." | |
n nrepl-opts NREPL_OPTS edn "Options passed to the `repl` task." |
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 greet-number | |
"I say hello to an integer" | |
[num] ;; an integer | |
[:div (str "Hello #" num)]) ;; [:div "Hello #1"] | |
(defn more-button | |
"I'm a button labelled 'More' which increments counter when clicked" | |
[counter] ;; a ratom | |
[:div {:class "button-class" | |
:on-click #(swap! counter inc)} ;; increment the int value in counter |
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- filter-todos | |
[todos current-filter] | |
(case current-filter | |
"SHOW_ALL" todos | |
"SHOW_ACTIVE" (filter #(false? (:completed %1)) todos) | |
"SHOW_COMPLETED" (filter #(true? (:completed %1)) todos))) | |
(defn- visible-todos-query | |
[state [query-id]] | |
(println "visible-todos-query called") |
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
;; Note, you'll want to install: auto-complete clojure-mode cider ac-cider | |
(require 'ac-cider) | |
(add-hook 'cider-mode-hook 'ac-flyspell-workaround) | |
(add-hook 'cider-mode-hook 'ac-cider-setup) | |
(add-hook 'cider-repl-mode-hook 'ac-cider-setup) | |
(eval-after-load "auto-complete" | |
'(progn | |
(add-to-list 'ac-modes 'cider-mode) | |
(add-to-list 'ac-modes 'cider-repl-mode))) |
NewerOlder