This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-15
Channels
- # admin-announcements (10)
- # aws (2)
- # beginners (27)
- # boot (3)
- # cbus (4)
- # cider (1)
- # clara (6)
- # cljs-dev (3)
- # cljsrn (14)
- # clojure (98)
- # clojure-boston (1)
- # clojure-brasil (1)
- # clojure-czech (3)
- # clojure-dusseldorf (11)
- # clojure-greece (3)
- # clojure-japan (3)
- # clojure-korea (1)
- # clojure-russia (138)
- # clojure-uk (11)
- # clojurescript (76)
- # component (2)
- # core-matrix (1)
- # cursive (25)
- # data-science (3)
- # devcards (1)
- # euroclojure (4)
- # events (3)
- # funcool (1)
- # hoplon (219)
- # immutant (40)
- # juxt (8)
- # leiningen (1)
- # off-topic (34)
- # om (148)
- # onyx (10)
- # overtone (2)
- # proton (1)
- # re-frame (8)
- # reagent (3)
- # ring-swagger (5)
- # spacemacs (17)
- # untangled (47)
- # yada (19)
@mrg sorry about that! we do have an errata listed on it (https://pragprog.com/titles/vmclojeco/errata) for the next edition
is there any library which extracts table definitions form pg/mysql/sqlit into a datastructure?
Thanks @alexmiller! I already added it there!
Quick question: I'm building an AWS-Lambda based project, but since Lambda doesn't provide ENV vars, i want to bake them into my uberjar (the password are encrypted before baking and decrypted in Lambda). I have found the Environ plugin to manage env variables, but I cannot find a way to bake env vars into the JAR.
So does anyone know how I can include env vars (flags) in my build so that they are available to the code running in the uberjar?
@vincentdm: you can put them in .lein-env if you use leiningen
Aah ok. I thought those were the ones that would be available locally. I must have misread the docs. Thanks!
@vincentdm: you can put the environment variables in your project.clj, lein environ then spits them out to .lein-env
@vincentdm: and using profiles you can then differ between dev or prod, etc
@vincentdm: you have to add the leiningen plugin, just read the docs of lein environ
yeah I did... but I interpreted it as if the .lein-env was for overriding the env vars of the machine the code is running on.
@jstaffans: I know, but since cold Lanbda's are already quite slow, I'm reluctant to add yet another request.
I'm currently planning to decrypt the baked-in secrets using KMS on the Lambda's first run, and cache them in the /tmp folder
(I know I can also do that with the secrets I fetch from S3, but I like it better if my JAR contains everything I need)
have you measured the impact of one request to S3? I’d assume it would be plenty fast
However, I understand if you don’t want to bloat your JAR with more of the AWS SDK just to get a config file..
yeah, and the idea of managing the bucket permissions, making sure each env fetches the right keys from it... I prefer containing it all in the jar. But I'm aware of danger of premature optimization...
i’m a little lost trying to wrap a macro function into an app-specific function that is called with default parameters.. how do you do this in clojure? e.g.
(app-http “GET” {:args …})
(defn app-http [url & args]
(ajax/GET url args)) <— this is a macro from another lib
my specific use-case is I want an app http library that wraps particular invocations to GET/POST/DELETE with various interceptors … for auth, cache, jwt, etc.
but I don’t want to litter my codebase with (ajax/GET “/api” {:interceptors [a b c d]})
@lwhorton: I think this will depend on how ajax/GET macro is written, if it expects explicit map during compile time, then you will have to write a macro to do that
Does anybody know a good tutorial or just rules on naming namespaces? For example, I have such namespaces as loader
, processor
and saver
. They look pretty bad, especially processor
, because it means nothing. Is it a good idea to give more specific names? Say, tweets-loader
, tweets-processor
. Actual code is here: https://github.com/abtv/tech-radar/tree/master/src/clj/tech_radar/services
Hello everyone, I am about to start on a fairly complex full-stack project and am considering Clojure/ClojureScript for it - what is the up-to-date 2016 approach to building a complex Clojure back-end? Is it ring + roll your own or is there a well-maintained set of libraries/framework?
@clomat: http://www.luminusweb.net gives an overview of libraries you can use together
thanks @darwin, I figured that would be the case: https://github.com/JulianBirch/cljs-ajax/blob/master/src/ajax/core.cljc#L573
@abtv, sub-namespaces might help you out here: services.twitter.loader
and services.twitter.processor
.
@lwhorton: just skimmed the sources and it seems the ajax/GET is a normal method (generated by a macro for some reason)
o? it looked to me like the call to get was doing a macro-rewrite to lower-level (http {:method “GET” :args …})
, ill take a closer look
@borkdude Thanks! Also how would you say the split between Backend(Clojure) vs Frontend(CLJS) is in the community, ie which one would you say is more active, if you know?
@lwhorton: https://github.com/JulianBirch/cljs-ajax/blob/master/src/ajax/macros.clj#L7
a side note: to me it is not obvious why that must be a macro, a plain function for generating that function would work just fine IMO, also using symbols like this does not serve any purpose, just a noise IMO https://github.com/JulianBirch/cljs-ajax/blob/master/src/ajax/macros.clj#L4
I’m pretty new to clojure so i have a hard time evaluating the quality of a library. It seems to be the only cljs-compatible one with interceptors, though.
@lwhorton: did you post this issue? https://github.com/JulianBirch/cljs-ajax/issues/139
I did find a workaround per the suggestion. I like to avoid globals such as their implementation of a global atom default-interceptors
, though.
My thought was just wrapping everything get/post/put etc with default-interceptors or method-specific interceptors.
Have people compared Spectre to Jai? What differences / tradeoffs does each library make? https://github.com/nathanmarz/specter https://github.com/zcaudate/jai
is there an idiomatic if thing then thing else otherthing
short of (if (:key thing) (:key thing) (otherthing))
(to avoid repetitiveness)?
if i want to search a vector of maps and return that single map if found, is this the best way of doing it? '(into {} (map #(if (= 1 (:vlan %)) %) vlan-data))))' assuming i have two or more maps in a vector with a key of :vlan.
Is the code block at https://github.com/clojure/core.async/wiki/Go-Block-Best-Practices#general-advice beginning with (defn http-call
missing something? The block's last line (load-urls urls)
calls a 2-arity function with a single argument?
Is it possible to “extend-protocol” with a multi-arity protocol? (extend-protocol proto recordType (foo [_ a] …) (for [_ a b] …))
?
Node if it's brain dead simple web crud and you'll probably throw it away otherwise Clojure
from this day forward I decided that i'm not gonna look at other languages..//it's distracting to look and wonder about other tech @arrdem hehe
Sometimes you want to do one thing, then another, then another, and node makes that so … problematic.
yeah, I haven't run into any issue so far; I am not a node expert or anything but it works fine, the only tricky thing is that everything is async and runs on the event loop, I wasn't used to that at first
I just started playing with AWS lambda, I didn't want to deal with JVM start up time for that
core.async channels help, for example every call in the AWS node SDK takes a callback which returns the result, so if you are making several calls you could end up in callback hell or have to pass around some global atom; channels let you avoid that
Heya, does anybody know how to go about reading the meta-data from an mp4 file/image file?
@lucelios, never had to do it myself but a quick search turned up https://github.com/funcool/clojure.jdbc.
I use that ^ I would not use Korma. Apparently there is also HugSQL, which I haven't personally used
I tend to use honeysql+clojure.java.jdbc
@donaldball: That's the combo I use too. Or just clojure.java.jdbc. I have mixed feelings about piling one DSL on top of another.
If you need connection pooling I've used BoneCP, it works well. http://www.jolbox.com/