This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-06
Channels
- # 100-days-of-code (15)
- # beginners (32)
- # calva (2)
- # cider (37)
- # clara (1)
- # cljs-dev (47)
- # clojure (177)
- # clojure-boston (1)
- # clojure-dev (2)
- # clojure-germany (1)
- # clojure-greece (5)
- # clojure-italy (13)
- # clojure-nl (2)
- # clojure-sanfrancisco (1)
- # clojure-uk (72)
- # clojurescript (46)
- # cursive (20)
- # datascript (7)
- # datomic (14)
- # devcards (6)
- # docker (1)
- # duct (1)
- # emacs (1)
- # figwheel (3)
- # figwheel-main (151)
- # graphql (2)
- # hyperfiddle (1)
- # interop (3)
- # jobs (3)
- # lumo (2)
- # off-topic (21)
- # pedestal (1)
- # re-frame (9)
- # reagent (25)
- # shadow-cljs (57)
- # slack-help (4)
- # specter (21)
- # tools-deps (53)
- # vim (2)
With this, I can send to browser download
(let [url (.createObjectURL js/URL (.getRecordingFile @msr))
linkDownload (.createElement js/document "a")]
(set! (.-href linkDownload) url)
(set! (.-download linkDownload) "fernando.mp3")
(.append (.getElementById js/document "app") linkDownload)
(.click linkDownload)
(.revokeObjectURL js/URL url)
(.remove linkDownload)
)
. Is there any way to automatic upload to ring
url?@fabrao For file uploads with Ring, you should have a look at multipart-params
. https://github.com/ring-clojure/ring/wiki/File-Uploads
Include javax.servlet/servlet-api {:mvn/version "2.5"}
, or it’ll complain of missing deps.
is this valid regex in cljs/js \/+$
?
it prodcues this regex once compiled: /\\/+$/
which is not valid in JS
it double escapes the /
thanks @mfikes!
how else would i create a regex like that, then?
@kucerm2 With ClojureScript type hints
(defn ^{:tag #{string clj-nil}} foo [x] (when x "a"))
and with spec
(s/fdef foo :ret (s/nilable string?))
Note that the next release of ClojureScript will infer this type hint for the foo
example above.
@biscuitpants You could do it via interop: (js/RegExp. "\\/+$")
ah yeah i thought to do that. thank you @mfikes
@lilactown what are you envisioning?
I highly reccomend https://github.com/bhauman/cljs-test-display for tests
e.g. I have a foo.bar-tests
ns that currently is run in node.js and I want to import that into my foo.bar-devcards
so I get a visual
in favor of using the separate test runner, we have tests in devcards on an older library of ours. and you have to navigate to all of the cards to see your tests run and scroll to see that they are all passing. the test runner does the favicon and notification popups of all tests all the time. quite nice
was trying to tell lilactown that my experience with them separate (and running concurrently) has been quite nice
I can run chesire just fine with lein figwheel, but when I do the production build, it can't find chesire. What gives?
so I have just discovered I cannot do the following, is it expected:
(goog-define CLOUD-PROVIDER "none")
(def ^{:dynamic true}
*cloud-provider* CLOUD-PROVIDER)
it looks like the value of *cloud-provider*
is not set by the goog-define
I don't know 😄 I though it would work, trying a couple of things
it seems like it is working, but for some reason when I println
the values of the two, they differ...
@richiardiandrea might be worth looking at js/CLOSURE_UNCOMPILED_DEFINES
lemme see
yep it is there actually, I am now checking the value
maybe it was a false alarm, now everything seems ok
I swear I have seen the dynavar different from the goog-define, but now I cannot reproduce
but thanks for the trick 😉
No prob. You can even alter it via
(set! js/CLOSURE_UNCOMPILED_DEFINES #js {"cljs.user.CLOUD_PROVIDER" "a"})
To do that, you’d need to re-evaluate
(goog-define CLOUD-PROVIDER "none")
and things that depend on the value.
Normally you wouldn’t do stuff like this, but it illustrates the mechanism so this basically does the set!
as side effect am I right?