Format: <type>(<scope>): <subject>
<scope>
is optional
feat: add hat wobble
*.clj diff=clojure | |
*.cljs diff=clojure | |
*.cljx diff=clojure |
(defn form-spec [spec err-format] | |
(with-meta (s/spec spec) {:err-format err-format})) | |
(s/def ::number (form-spec int? (fn [k v] (str (name k) " is not a valid number: " v)))) | |
(s/def :address/apt (form-spec ::number (fn [_ v] (str "wrong apartment number: " v)))) | |
(s/def :address/strno ::number) | |
(s/def :address/street string?) | |
(s/def ::addr (s/keys :req-un [:address/apt :address/street :address/strno])) |
;; https://matthewdowney.github.io/forcing-jvm-heap-dump-programmatically-clojure.html | |
(import 'java.lang.management.ManagementFactory) | |
(import 'com.sun.management.HotSpotDiagnosticMXBean) | |
(let [server (ManagementFactory/getPlatformMBeanServer) | |
bean-name "com.sun.management:type=HotSpotDiagnostic" | |
bean (ManagementFactory/newPlatformMXBeanProxy server bean-name HotSpotDiagnosticMXBean) | |
live-objects-only? false] | |
(.dumpHeap bean "dump.hprof" live-objects-only?)) |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
lein update-in :dependencies conj \[nrepl/nrepl\ \"0.6.0\"\ \:exclusions\ \[org.clojure/clojure\]\] \ | |
-- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] \ | |
-- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] \ | |
-- "$@" |
.blob-num, | |
.blob-code-inner { | |
font-size: 17px; | |
font-family: "CamingoCode"; | |
-webkit-font-smoothing: subpixel-antialiased; | |
line-height: 25px; | |
} | |
.blob-num, | |
.blob-code-inner, |
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
(defn heredoc [] | |
(let [delim (.readLine *in*)] | |
(->> (repeatedly #(.readLine *in*)) | |
(take-while #(not= delim %)) | |
(interpose \newline) | |
(apply str)))) | |
; The following lines are read (by the reader) as: | |
; "Look )(\"\\T\na here doc!\n" | |
#=(heredoc)""" |