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
;; Transducer to transform | |
;; | |
;; [user [name email] foo bar [baz]] | |
;; | |
;; into | |
;; | |
;; [[user [name email]] [foo nil] [bar [baz]]] | |
;; | |
;; when transducing like this: | |
;; |
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 pad-by | |
([pred pad] | |
(fn [rf] | |
(let [pv (volatile! ::none)] | |
(fn | |
([] (rf)) | |
([result] (rf result)) | |
([result input] | |
(let [prior @pv] | |
(vreset! pv input) |
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
405: Method Not Allowed | |
A request was made of a resource using a request method not supported by that resource; | |
Method Not Allowed | |
#error { | |
:cause "Method Not Allowed" | |
:data {:status 405, :headers {"allow" "OPTIONS"}} | |
:via |
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
java.lang.NullPointerException | |
at yada.resources.classpath_resource$new_classpath_resource$fn__25819.invoke(classpath_resource.clj:22) | |
at yada.handler$handle_request_with_maybe_subresources.invokeStatic(handler.clj:97) | |
at yada.handler$handle_request_with_maybe_subresources.invoke(handler.clj:82) | |
at yada.handler$handle_request.invokeStatic(handler.clj:163) | |
at yada.handler$handle_request.invoke(handler.clj:156) | |
at yada.handler.Handler.request(handler.clj:210) | |
at bidi.ring$make_handler$fn__16551.invoke(ring.clj:43) | |
at aleph.http.server$handle_request$fn__13897$f__1683__auto____13898.invoke(server.clj:153) | |
at clojure.lang.AFn.run(AFn.java:22) |
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 server.services.web-server | |
(:require [aleph.http :as http] | |
[bidi.ring :as br] | |
[clojure.java.io :as io] | |
[clojure.tools.logging :refer [info]] | |
[mount.core :refer [defstate]] | |
[yada.yada :refer [yada]] | |
[yada.resources.classpath-resource :refer [new-classpath-resource]] | |
[server.config :refer [config]])) |
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
Retrieving crouton-0.1.2.jar from https://clojars.org/repo/ | |
Retrieving clj-http-1.0.1.jar from https://clojars.org/repo/ | |
Retrieving potemkin-0.3.8.jar from https://clojars.org/repo/ | |
Retrieving httpclient-4.3.5.jar from https://repo1.maven.org/maven2/ | |
Retrieving jsoup-1.7.1.jar from https://repo1.maven.org/maven2/ | |
Retrieving httpmime-4.3.5.jar from https://repo1.maven.org/maven2/ | |
Retrieving httpcore-4.3.3.jar from https://repo1.maven.org/maven2/ | |
clojure.lang.Compiler$CompilerException: java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap, compiling:(clj_http/headers.clj:105:1) | |
java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap | |
... |
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
;; .clj | |
(defn defcomponents* | |
[components] | |
`(let [components# (~'js->clj ~components) | |
defcomponent# (fn [[n# c#]] | |
`(defn ~(symbol (str n# "-component")) [] | |
"foo"))] | |
`(do | |
~@(map defcomponent# components#)))) |
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
~/W/v/cljs-audio-utils (jannis/mp3-encoder) $ git diff | |
diff --git a/src/devcards/audio_utils/devcards/mp3_encoder.cljs b/src/devcards/audio_utils/devcards/mp3_encoder.cljs | |
index 5a5813f..121651a 100644 | |
--- a/src/devcards/audio_utils/devcards/mp3_encoder.cljs | |
+++ b/src/devcards/audio_utils/devcards/mp3_encoder.cljs | |
@@ -72,11 +72,15 @@ | |
(reduce (fn [length-so-far buf] | |
(doseq [channel (range 0 (.-numberOfChannels buffer))] | |
(let [in-chan (.getChannelData buf channel) | |
- out-chan (.getChannelData buffer channel)] |
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
;;;; Works | |
(ns workflo.macros.scratch | |
(:require #?(:cljs [cljs.spec :as s] | |
:clj [clojure.spec :as s]) | |
[clojure.test.check.generators :as gen])) | |
(s/def ::item | |
symbol?) |
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
boot.user=> (require 'workflo.macros.props :reload) | |
boot.user=> (in-ns 'workflo.macros.props) | |
;; Validate and parse the properties destructuring syntax using | |
;; `clojure.spec/conform`: | |
workflo.macros.props=> (s/conform ::properties-spec '[db [id] {users [user [name email]]} [current-user _]]) | |
[[:properties {:base db, :children [[:name id]]}] | |
[:property [:join [:properties-join {users [user [name email]]}]]] | |
[:property [:link {:name current-user, :link-id _}]]] |