This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-04
Channels
- # aleph (24)
- # beginners (60)
- # cider (20)
- # clara (4)
- # cljs-dev (13)
- # cljsrn (4)
- # clojure (66)
- # clojure-italy (32)
- # clojure-nl (4)
- # clojure-serbia (1)
- # clojure-uk (207)
- # clojurescript (115)
- # cursive (3)
- # datomic (36)
- # defnpodcast (1)
- # duct (15)
- # fulcro (14)
- # graphql (8)
- # lein-figwheel (1)
- # leiningen (4)
- # off-topic (140)
- # pedestal (40)
- # portkey (3)
- # reagent (40)
- # remote-jobs (1)
- # ring (11)
- # shadow-cljs (31)
- # spacemacs (6)
- # sql (65)
- # tools-deps (67)
- # yada (1)
Does Leiningen has a way to search templates?
@stardiviner Not sure what you mean by that...?
@seancorfield Leiningen has a command lein new [template]
to use that template to generate project. I'm curious whether has a way to search those templates.
That should give you a fairly complete list.
Just FYI, boot-new
supports both Leiningen templates and Boot templates https://clojars.org/search?q=boot-template
And clj-new
supports both of those and clj-templates
too (although I expect there aren't any of those yet)
Hi all, I am totally new in Clojure here, have a simple question to ask, why (conj (reverse [4 3]) 2 1) will evaluate as (1 2 3 4) instead of (3 4 2 1) ?
@tthock A good way to understand is to break it into its subexpressions -- what does (reverse [4 3])
produce?
Right, so when you conj
onto a sequence, it puts the items on the front.
conj
only puts items on the back if the collection is a vector.
so (conj [4 3] 2 1)
will produce [4 3 2 1]
thanks for your input. @seancorfield
@seancorfield clj-templates
? Thanks
@stardiviner Yes, foo/clj-template
would be searched for by clj-new
-- but there aren't any yet (I suspect we'll see them as Git coordinates instead of releases on Clojars).
clj-new
looks for clj-template
first, then lein-template
then boot-template
I'm checking out clj-template. Is clj-new
supported by CIDER
? Or clj-new
can be manually setting in CIDER to use directly?
clj-new
creates new projects -- so CIDER support doesn't make much sense
clj-new
is the clj
version of boot-new
or lein-new
Let me take a try. I think it should can work directly.
If you're using the clj
script, having clj-new
as an alias is convenient -- https://github.com/seancorfield/dot-clojure
@seancorfield Seems you updated it recently since I last update.
Possibly. Mostly cosmetic updates lately tho
I tested with Emacs CIDER, CIDER seems support project with deps.edn
So clj-new
(clj-template) is supported.
@seancorfield You might need to improve dot-clojure README, the :new
alias require project name as kk/kk2
style. I don't know which one is used for lein template like lein new compojure [project-name]
.
I tried both clj -A:new demo/compojure
and clj -A:new compojure/demo
. Neither has compojure
dependencies included in deps.edn
. Seems not using lein-template
.
clj -A:new compojure myname/myapp
-- the dot-clojure project is just aliases, read the clj-new project readme for details on how the underlying project works
@stardiviner The dot-clojure readme links to the clj-new project which explains the usage https://github.com/seancorfield/clj-new#general-usage
And the deps.edn
file in dot-clojure has usage examples too https://github.com/seancorfield/dot-clojure/blob/master/deps.edn#L46 -- not sure what I could do in the dot-clojure readme to make anything clearer (it deliberately links to all the projects it provides aliases for) but concrete suggestions are always welcome...
Which template you use determines what type of project gets generated. compojure
uses Leiningen (`compojure/lein-template` is the artifact that is used) so you get a project with project.clj
-- clj-new has no control over that.
Did I misunderstand this clj -A:new
funciton?
I am having problem with Emacs, Cider and Weasel. I can connect to a browser repl and eval code from the repl and that will effect my browser. So cljs.user> (js/alert "Hello world!")
works just fine. But when i do cider-eval-last-sexp
in one of the project files it gives me an error, anyone faced this?
I'm implementing github oauth in a webapp.
In a nutshell my problem is that on the initial request where the user authenicates the app the ring session is lost, but on following requests the oauth flow works fine.
In slightly more detail, here is what happens in the code step by step:
1) On a login-with-github route, my app sets a random "state" value in ring session and return redirect response to
2) On Github: the user authorizes the web app and github redirects the user back
3) On the target URL that github returns the user to with a temporary access code the ring session is empty {}
The state value that is required to exchange the code for an access token is not available
--- at this point in time the app has successfully been authorized. ---
4) On a new request, exactly the same code is run as in 1)
5) Because the app already is authorized, github redirects the user back to the webapp immediately with the temporary code
6) On the target URL that github returns the user to with a temporary access code the ring session this time is not empty but contains all the expected data
So on "my" side the same code runs in both cases. Github redirects to the same URL. Any ideas why the session is lost in the first case?
The only difference I can see are the couple of seconds it takes a user to click the "Authorize" button on github.
Small udate: the session is lost because the cookies are lost. Now the question is, why are the cookies lost in the once case and not the other?
Wanted to import the spec namespace in order to generate regex parser, instead of writing my own, and figured out the spec is in alpha. Even though I though it was introduced a long time ago
There probably will be some breaking stuff, probably breaking libraries like spec-tools.
there are some changes under way that will alter the spec implementation (api is likely to stay pretty close to current)
In Datomic how would I model a Runner's time during a race? for example "Alice" started at 10:35 but is still currently running. Would I have a :end nil
then (update :end (now))
when she finishes?
But then I need to ask question about the system such as "Who is currently running?"
you can’t transact a nil (as it’s the absence of data), so you would just add the :end
attribute when done
and you can query for entities that have an :end
attribute
btw, prob better to ask this stuff in #datomic
@alexmiller Thanks
clj -A:new compojure myname/myapp
-- the dot-clojure project is just aliases, read the clj-new project readme for details on how the underlying project works
How would I handle distributed transactions in clojure? I was looking at this elixir library https://github.com/Nebo15/sage and curious how I would do something like this in clojure. Core.async?
I think I saw support for this in Immutant? By way of wrapping a Java lib... and needs to be run inside the WildFly container... no personal experience.
RE: lein templates https://www.reddit.com/r/Clojure/comments/2qmrdk/finding_all_available_lein_templates/
what’s the spec for data that looks like this → “(” + expr + “)” I was trying to do like this, but no results:
(s/cat :left-br #"\("
:expr ::expr
:right-br #"\)")
"(" + expr + ")" is typically what you would see if you are trying to parse a stream of text in to a datastructure
I'm trying to query a database via jdbc and return json using clojure. I think this should be easy, but I haven't found any example doing a search. Any examples y'all could recommend?