Fork me on GitHub
#beginners
<
2022-11-20
>
leinfink00:11:33

In a similar direction: I have a bit of conceptual confusion about tools.deps relationship to leiningen. Say for example I just added ring as a dependency via my deps.edn. Now, ring also has dependencies, but as far as I can see, it's using defproject macros for that, so leiningen. But somehow that's all taken care of and works. How come? šŸ™ˆ

hiredman00:11:06

They are maven dependencies

hiredman00:11:19

Lein and tools.deps both can consume maven dependencies

hiredman00:11:09

So while ring defines it's dependencies using leins defproject, lein was used to generate a jar and pom from that, and that is published to a maven repository somewhere

hiredman00:11:48

And lein, tools.deps, maven, gradle, etc all can consume from maven repos

leinfink00:11:42

ah, thank you!

valerauko07:11:38

is there a function that does the opposite of select-keys? an "except-keys" or "without-keys"

valerauko07:11:39

apply dissoc did the trick

James Pratt13:11:10

Is it possible to play with this java library for which I have maven repository coordinates in the REPL? https://developers.google.com/google-ads/api/docs/client-libs/java/getting-started

James Pratt13:11:32

I seemed to have specified the dependency for my project correctly in deps.edn

;; <dependency>
;; <groupId></groupId>
;; <artifactId>google-ads</artifactId>
;; <version>22.0.0</version>
;; </dependency>

{:paths ["src"]
 :deps {com.google.api-ads/google-ads {:mvn/version "22.0.0"}}}

James Pratt13:11:11

But not sure if I need a require in a namespace

James Pratt13:11:34

and not sure how to call code

pavlosmelissinos13:11:16

Yes, dependencies on projects are defined at the project level (deps.edn) and dependencies on classes/namespaces at the namespace level. You need both. Dependencies on Java classes are declared with import, not require. You can check these docs for more information: ā€¢ How to declare a dependency on Java classes: https://www.clojure.org/guides/learn/namespaces#_java_classes_and_imports ā€¢ How to actually do Java interop: https://clojure.org/reference/java_interop

James Pratt13:11:05

thanks! Will explore further.

pavlosmelissinos13:11:45

Happy to help if you have more specific questions šŸ™‚

walterl16:11:03

For one-offs you can specify deps directly on the command-line: clj -Sdeps '{:deps {com.google.api-ads/google-ads {:mvn/version "22.0.0"}}}'

James Pratt12:11:07

Before I try to authenticate with oauth2 to use this client library I need to work out how to spin up a server with a url for the callback and https. I'm going to look into deploying to heroku which would seem to be the easiest way to get a server up and running.

George16:11:41

hi, I have a Compojure route (GET "/" [] (content-type (resource-response "index.html" {:root "public"}) "text/html")` but the browser downloads the file instead of displaying it -- I thought setting the content type would fix this (as in https://stackoverflow.com/questions/35548372/file-is-downloaded-instead-of-being-displayed-in-the-browser) but I still have the same problem

George16:11:21

I must be making a basic mistake here?

George16:11:15

also I'm already adding site-defaults from ring-defaults, so I thought I didn't need content-type anyway?

George17:11:00

this seems related to the open PR https://github.com/ring-clojure/ring/pull/452 -- but this is pretty basic right? I wonder how people normally do this.

George17:11:37

well I don't know what I did, but now somehow it works with the same code...some kind of inconsistent state somewhere?

George17:11:56

yeah something is weird, because now it doesn't work again.

jumar09:11:54

Can you inspect the http response headers in the browser and see if there's something odd, notably in with the content-type?

Falak Shair19:11:16

Hi, I am unable to connect repl in the atom (packages:proto-repl & ink), and why these packages are deprecated. Is there any other way/package to connect repl.

seancorfield20:11:29

Atom is essentially dead. There's a community project called Pulsar to continue it on.

seancorfield20:11:02

Join #CPUTQ6PV5 and ask there about it. I don't have links, sorry.

seancorfield20:11:43

I switched from Atom to VS Code a while back because of that. Calva for VS Code is great.

Falak Shair20:11:29

@U04V70XH6 I am switching too. Thanks:+1:

Falak Shair20:11:06

@U04V70XH6 Would you recommend other useful extensions in VS code?

seancorfield20:11:02

I use Calva and Joyride. Plus the Atlassian extension for work (Jira and BitBucket). I'm not at my desk right now but can look at other extensions later.

seancorfield20:11:01

OK, pulled up my laptop: Portal -- don't know how I forgot that one! GitHub Pull Requests and Issues, vscode-pdf, YAML. My VS Code / Calva / Portal setup is mostly in this repo: https://github.com/seancorfield/vscode-calva-setup and my CLI/`deps.edn` aliases and REPL-starting code is in this repo: https://github.com/seancorfield/dot-clojure

šŸ‘ 1