This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-21
Channels
- # architecture (9)
- # beginners (192)
- # boot (1)
- # bristol-clojurians (2)
- # cider (213)
- # cljs-dev (10)
- # clojure (195)
- # clojure-art (2)
- # clojure-austin (3)
- # clojure-belgium (4)
- # clojure-dev (4)
- # clojure-dusseldorf (1)
- # clojure-gamedev (9)
- # clojure-greece (21)
- # clojure-italy (27)
- # clojure-losangeles (2)
- # clojure-russia (1)
- # clojure-seattle-old (2)
- # clojure-serbia (1)
- # clojure-spec (114)
- # clojure-uk (136)
- # clojured (2)
- # clojurescript (100)
- # community-development (19)
- # core-async (12)
- # cursive (7)
- # duct (1)
- # figwheel (7)
- # fulcro (96)
- # hoplon (4)
- # jobs (2)
- # lein-figwheel (28)
- # leiningen (2)
- # luminus (14)
- # lumo (3)
- # off-topic (11)
- # om-next (2)
- # pedestal (10)
- # planck (11)
- # portkey (2)
- # proton (1)
- # protorepl (19)
- # re-frame (27)
- # reagent (12)
- # shadow-cljs (82)
- # spacemacs (42)
- # specter (15)
- # sql (3)
I just watched the video on vase and the concise amount of code used to generate the consumer report UI... I haven't found much more information on the UI part, as opposed the pedestal endpoints... can someone fill me in on what that is all about or where I can find out more?
he talks about reducing the front end code to 26 lines, but obviously there's a lot more, somewhere (as styles, largely, I'd guess), but I'm unclear of how it all works.
HI, does anybody use toucan
here? How do I make a query with multiple condition on a single field, I've tried
(db/select Model :start-time [:> start :< end])
but it resulted in a query with only start_time > start
conditionCould anybody explain how toucan options destructuring works? I understand it tries to simplify a HoneySQL form, I'm able to construct simple :=
queries, but it became more of a guessing game for me on complex queries with condition like :between
, :in
, and :order-by
Hey gang, trying to choose a sound reactive atom (ratom with cursors) library for JVM Clojure, what’s the best option do people think?
Possibly, I mean that’s more or less what I want (Rum might be even simpler), like something from https://github.com/tonsky/rum/blob/gh-pages/src/rum/cursor.clj
But I’ve got a non-UI use for it, wanting to do declarative music generation stuff, so a generic library which is used by other stuff might be preferable
you can use lein trampoline run
or lein trapoline ring server
- for that it helps to also have the LEIN_FAST_TRAMPOLINE
flag set in your environment https://github.com/technomancy/leiningen/wiki/Faster
but even better you can design your application so that it won’t need as many restarts during development https://github.com/stuartsierra/reloaded
err, this is a better link for the reloaded pattern http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
Yeah, I think jvisualvm is a decent one - especially if you have some experience with Java/JVM development.
@attentive I was thinking about this for a while. never used a library for it. I think my approach was to build declarative trees describing my audiograph, have one function for constructing it for real, another for updating the real model. Every time the user changed the tree I did a clojure.data/diff
to check what they had changed and use the update function to update the real model.
@serge I think a lot of the time has to do with the JVM and the way Clojure works. Lein uses multiple JVMs and has to load a number of classes. Also see: https://dev.clojure.org/display/design/Improving+Clojure+Start+Time http://clojure-goes-fast.com/blog/clojures-slow-start/ https://github.com/technomancy/leiningen/wiki/Faster
Thank you, @krauszraphael!
@edlich @mikeholmesuk How do you specify the username/password to use with Clarango?
Eesh, that takes me back. Haven’t looked at that for a while.
It takes a connection string so you can pass username and password in the url.
Hmm.... maybe I am using illegal characters in my password... let me try something simpler and see.
Indeed. Let me know how you get on and I can pu together a PR to update the docs
Yeah, they are a bit quiet in places. I noticed that when I was last working with it. Are you just starting out with it?
how can it pass an expression to lein repl
so that it evaluated when the repl is started?
... I was just about to say that... hmm... this is more a bash/shell question than a Clojure one.
thanks, i was hoping there would be something like lein repl -e "(println "hello world)"
but this will do
you can do exactly this with tools.deps
, I haven’t tried it out myself yet but it should just be clj -e '(println "hello world")'
hmm, I have a problem with sente. Getting Bad ev-msg
logs when client tries to connect to the server
started a new project where I took some earlier sente configs in which had worked before
with aleph adapter I got NPEs, when I switched to http-kit I get a bit more reasonable errors, which is what I'm seeing above
{:status :ready,
:val {:ws #{:taoensso.sente/nil-uid},
:ajax #{},
:any #{:taoensso.sente/nil-uid}}}
decided to dump sente for now, this project doesn't need it that much. Will dig into that later when I have more time
I tried to use sente twice, but both times I reverted to something use, I just needed websockets.
I had a similar experience and opted for https://github.com/jarohen/chord
+1 for chord, also dropped sente 🙂
the default is nil :)
docs are at https://clojure.org/reference/compilation#_compiler_options btw
@alexmiller The docstring for *compiler-options*
are out of date. It's missing direct linking.
It also mentions something about merging, which is what threw me off. I figured it was a caution against overriding the defaults.
Agreed, docstring is out of date, feel free to jira
@alexmiller fyi the image on http://clojure.org for your new book (congrats!) is not working
I noticed that. worked for me locally though
the image link is http://ecx.images-amazon.com/images/I/51Bvd25CstL._SL160.jpg
which works :)
@alexmiller I'm a bit confused by "priority" on JIRA. > Ignore these names and assume only relative priority Relative to what?
don’t set the priority
@alexmiller the width is being set as 3rd edition
in css which is probably why it’s not showing
@dominicm what that means is - the words here are unimportant (“Critical”, “Major”, etc), they are just used for relative ordering
@bronsa yup, thanks
> don’t set the priority Is it possible for the JIRA to have that written somewhere? "Contributors should not set the priority"
> An issue has a priority level which indicates its importance. The currently defined priorities are listed below. In addition, you can add more priority levels in the administration section. ^ I guess adding to this text.
I dont think I can change that text
It’s not a big deal
I just reprioritize it as needed
there’s a whole page at https://dev.clojure.org/display/community/Creating+Tickets about creating tickets
Contradicting advice is given by that page: > Priority: categorize based on impact and whether this is a theoretical issue or one actually encountered in real code
hard to get all that context into jira though
I just fix stuff during triage
I'm creating pdf reports with charts using https://github.com/clj-pdf/clj-pdf and the library from https://www.gicentre.net/utils/chart, my workflow is working right now using quil to output svg and adding it to the pdf.
Is it a good way to make this kind of pdf reports with clojure or am I missing something?
is there already a name for monad, which is like either
, but instead of left/right
it has error/value
with the same meaning?
I don't want to call it either
, since user might think it expects :left :right. On the other hand, we have :error :value all over the code base already
and I don't want to go with actual monads, since it'll spread like cancer all over the place in no time
since I am not actually naming a monad, but a set of custom threading macros, I don't want to use either
, so nobody would confuse it with actual left/right
either
from cats or whatever lib might appear in project.
I've faced with the same problem, but as for today everything except either is still a compromise and has just a bit wider meaning
@misha Not sure how useful it might be to you, but you might be interested in looking at a beanbag lib I wrote several years ago as a kind of design experiment. https://github.com/manutter51/beanbag
@manutter51
> Wrap your function call inside a when-result block to read the status keys used by ok, fail and skip.
this requires altering a bunch of code, instead of providing convenience of threading macro, such as some->
the idea is to: - shortcircuit on the first value containing :error, - unwrap values wrapped in :value before threading further - wrap last value in :value, if not wrapped already
what I would recommend doing, instead of writing lots of custom ->
operators, is to write lift
I might replace it with lift someday, when bigger picture is more clear, and tech debt time budget is fatter.
@stuarthalloway I like the idea of https://github.com/cognitect-labs/anomalies, any plans on that?
that is the plan - use it if you like :)
But pretty much, yes. I wouldn't expect it to be difficult for most apps though. I've not found it to be difficult though
ok nice, I tried yada like 2 years ago when it was new, me and yada have matured probably since then. But at the time I was useing it for websockets and server sent events.
but got the feeling, that one had to be sold on the whole yada thing. probably wrong impression
there’s also buddy
I’ve heard some complaints but wasn’t able to use either productively
ok, I'll give it a try, I think Friend is not being a friend to me, tough s/he may be a friend to others.
thanks for pointing out Auth0 https://github.com/cjohansen/auth0-ring looks good!
we use buddy for jwt validation. put in a PR and they updated it for what we needed. simple changes and easy to use lib
@hlolli I switched to Buddy from Friend, found it a lot easier to work with
nice to hear, I've used friend now and then for last 2 years, of course when it works it works. But recently it's been getting on my nerves, especially with complicated and nested compjure routes, its behaviour is unpredictable, of course I'm doing something wrong, but the documentation and demos aren't helping.
I looked at using JWTs at one point, but I got scared off. http://cryto.net/~joepie91/blog/2016/06/13/stop-using-jwt-for-sessions/
yeh, I guess you can use ring-session and sign the passwords without useing jwt, but I'm not a security expert.
the only point in there that seems big to me is > You cannot invalidate individual JWT tokens
the rest he concedes they are just as nice as cookies or the deficiencies are in rare or obscure cases
> Now you are not vulnerable to CSRF attacks, but your application or site now requires JavaScript to work, and you've just made yourself vulnerable to an entirely different, potentially worse class of vulnerabilities. More about this below.
@dpsutton it’s true you can’t invalidate on a token level, but it’s easy to keep a whitelist of good tokens in your db
yeah true. but it is a valid point. they point out if you do that you might as well just do cookie sessions server side anyways. i don't think that follows and i like the jwt so far
JWTs are not a good fit for mutable session state, but they are great for authentication
and authorization if you construct them with whatever claims you need signed into the payload
@dpsutton now I see that article addresses that somewhat - but keeping a blacklist of expired tokens (or whitelist of good ones) is much simpler than a generalized distributed session
fwiw, I gave friend a few more minutes before I changed, the problem was, the auth endpoint (post version of login endpoint), was always redirecting to asbolute localhost address with port, and I didn't want a port forwarded server on port 80 with domain to be redirected to localhost:8080, so I attempted to use full path for the :login-url parameter, and there it got lost.
yeah, definitely don’t use jwt for arbitrary data - but for storing data that is permanently tied to an account on auth - hell yeah, reduce the number of lookups you do for user data
Interesting question. There’s a lot of good reasons not to use with-redefs btw
even for tests - for example using with-redefs means your tests can’t be run in parallel
is there a good way to sort things based on an array that dictates that order? ie when retrieving things from db with keys in this array, sort them according to the order of the array?
ok. that's the turn it into an val to index hashmap and sort by that. thanks @hiredman
> (zipmap arr (range))
I need to use this more. I always end up with (into {} (map-indexed vector …))