This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-21
Channels
- # announcements (3)
- # architecture (5)
- # babashka (19)
- # beginners (145)
- # calva (1)
- # chlorine-clover (18)
- # cider (10)
- # clj-kondo (5)
- # cljsrn (3)
- # clojure (56)
- # clojure-berlin (19)
- # clojure-czech (2)
- # clojure-europe (32)
- # clojure-finland (2)
- # clojure-nl (3)
- # clojure-portugal (2)
- # clojure-spec (8)
- # clojure-uk (48)
- # clojurescript (48)
- # conjure (50)
- # cryogen (1)
- # cursive (28)
- # datomic (54)
- # depstar (12)
- # emacs (1)
- # events (8)
- # figwheel-main (6)
- # fulcro (4)
- # helix (4)
- # java (2)
- # jobs (2)
- # leiningen (1)
- # off-topic (29)
- # parinfer (4)
- # pathom (6)
- # portkey (3)
- # reagent (1)
- # remote-jobs (3)
- # reveal (16)
- # shadow-cljs (42)
- # sql (20)
- # tools-deps (11)
- # vim (4)
- # vrac (2)
Is there any Promise.all alternatives? let's says i have list of chan '(c1, c2, c3) and i want to wait all of them to be resolved before i do operation to the list
this is the javascript regex I want to use /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
Well, at least I know. The bigger problem is that I am unable to transcribe it to clojurescript it seems. Need to rebuild it from ground up :-<
You probably should use a library for that. A JS one, likely. Emails are notoriously hard to get right.
Yep, that regex fails on e.g. Abc@[email protected]
.
Some other examples are here: https://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx/
"Note there is no perfect email regex" - yeah, that's what I don't like about all that. :)
Hmm, maybe. In this case, that article is wrong. TBH I didn't really delve into the RFC, but I remember distinctly battling with quite a few regexes to get some emails right.
If I were to start parsing email addresses from the ground up, I would probably generate the parser straight from the grammar defined in the RFC. No regexes allowed. :)
you know, RFC is request for comments, not a standard, it really doesn't solve the problem
there are more than one, I believe, and not everyone adheres to it. The backend people - not me - have to decide what email formats they let in the database. But then, they use Django ORM with something pre-baked, that I couldn't find it was coming from postgres or anything, so this regex is my attempt to move them into action, since if they have to support something like this, that is probably worse than anything they come up with by themselves
> RFC is request for comments, not a standard That's a very good point. I keep glancing over what "RFC" stands for. > there are more than one, I believe Oh, I've never heard about alternatives. Do you have any links?
> they use Django ORM with something pre-baked Ah, I would then immediately assume that it does something absolutely wrong. When it comes to Django, such reasoning has never failed me.
https://tools.ietf.org/html/rfc196, https://tools.ietf.org/html/rfc772, https://tools.ietf.org/html/rfc821, https://tools.ietf.org/html/rfc822, https://tools.ietf.org/html/rfc2821, https://tools.ietf.org/html/rfc2822, https://tools.ietf.org/html/rfc5321, https://tools.ietf.org/html/rfc5322 😄
Well, we are just building several financial products with old django, so it's all fine
As to why that RegEx above doesn't work with CLJS.
To convert it to a properly escaped string: JSON.stringify(/.../.source)
.
And then replace the [a-zA-Z\-0-9]
part with [a-zA-Z0-9-]
. Not sure why CLJS doesn't like -
in the middle.
Thanks, I will try it. Right now I am just trying to boot up my dev env. For half an hour now. The joys of development that apparently evades everyone but me.
Not really, but usually it doesn't happen once you set it up properly. O(1), so not many are vocal about it.
i have 3 or 4 machine setups every year. Every language + every editor it's own problem.
"3 or 4 machine setups every year" doesn't sound like your regular Joe's workflow. Same for "every language + every editor" - except for a few corner cases, I always use the same combinations.
Time to write some scripts I guess. :) Quite a few people do that to make any new setup as painless as possible. I don't do that - I change machines once every few years, so it's not a big deal for me.
Right, because scripts will not add complexity but reduce it. I like how that goes. Tell me which scripting should I use. I want to to work for macos, win10 and linux only
Well, I'm afraid I'm out of suggestions for those kinds of Swiss knives. :) Except for some meta-measures, like simply avoiding doing work that requires a bazillion of setups. But those are obvious.
just to save some face for django, here is their regex https://docs.djangoproject.com/en/2.2/_modules/django/core/validators/
@raefaldhiamartya I only know of p/all
from promesa: https://github.com/funcool/promesa
If you're using shadow-cljs: https://shadow-cljs.github.io/docs/UsersGuide.html#shadow-env