Fork me on GitHub
#babashka
<
2022-01-27
>
kipz12:01:10

xclip -o | jet -p happens a lot in my terminal

❤️ 1
kipz12:01:42

Add -f for much goodness

prepor15:01:53

Hi! Any tips how to make hash (md5) of file content without reading of whole file to a memory? org.babashka/buddy has md5 function which accepts input-stream, but pod's serialization protocol doesn't suport input-streams. Thank you!

borkdude16:01:29

@prepor in bb you can use java.security.MessageDigest . Also this library works with bb (as a dependency in bb.edn): https://github.com/clj-commons/digest which is based on MessageDigest

lukasz16:01:26

you can also shell out to openssl

prepor16:01:33

@lukaszkorecki or call md5, but I want to minimize external dependencies. @borkdude thank you!

lukasz16:01:04

Absolutely, as usual the "it depends" law of everything (™️) applies

Jakub Holý (HolyJak)19:01:01

In https://babashka.org/fs/babashka.fs.html#var-list-dir , what is the "accept" part supposed to be? I cannot find / see the docs for that 🙏

borkdude19:01:00

@holyjak it's a function of each entry in the directory, a predicate

🙏 1
borkdude19:01:10

Docs need to be improved obviously

borkdude19:01:48

$ bb -e '(fs/list-dir "." prn)'
#object[sun.nio.fs.UnixPath 0x23917ead "./.lein-failures"]
#object[sun.nio.fs.UnixPath 0x6fa205fb "./project.clj"]
#object[sun.nio.fs.UnixPath 0x3d8b8648 "./inlined"]
#object[sun.nio.fs.UnixPath 0x6f8a187 "./.dir-locals.el"]
#object[sun.nio.fs.UnixPath 0x6a0eed37 "./.carve"]
#object[sun.nio.fs.UnixPath 0x2ae3119c "./screenshots"]
#object[sun.nio.fs.UnixPath 0x53f38e54 "./.DS_Store"]
...

borkdude19:01:56

Please file an issue or PR about this

1
borkdude20:01:31

Thank you! Doc page is also updated

Jakub Holý (HolyJak)20:01:42

Thank your for all the awesome work! :)

❤️ 1
Jakub Holý (HolyJak)20:01:18

Hm, I see that CljDoc import failed for babashka.fs 😭 https://cljdoc.org/d/babashka/fs/0.1.2/doc/readme

👀 1
lread21:01:05

@borkdude, this failure is due to cljdoc assuming that there is ClojureScript in the fs lib because it is analyzing a cljc file (`fs.cljc`). But your are cljc for bb/clj not cljs/clj, yeah?

borkdude21:01:47

for cljdoc it would be sufficient to only analyze the .clj part

lread21:01:25

Yeah, makes sense. There is an open issue to allow analysis platform selection via cljdoc.edn.

lread21:01:22

But also… you are hosting your own API docs for fs. So not a big concern for you at the moment, I’m guessing!

borkdude21:01:46

Neh, I don't really look at cljdoc, I've kind of given up on it after many analysis failures, sorry

😢 1
borkdude21:01:55

Maybe I would try again if cljdoc.edn could be configured to have clj-kondo analysis ;)

lread21:01:40

Yeah, that’s certainly an idea. I don’t think many projects really require namespace loading. It would almost be tempting to maybe default to a clj-kondo analyzer and allow selection of a codox-loading-type analyzer.

Jakub Holý (HolyJak)21:01:39

I love Cljdoc - > Dash integration for all docs offline at 1 place

simple_smile 1
lread21:01:29

I laugh, I cry, what an emotional thread!

🙂 1
❤️ 1
borkdude21:01:22

I love (the idea of) cljdoc, I'm just too lazy to make it work. It crashed on nearly all of my projects

lread21:01:40

Yeah, you are not the person I think of when I hear the word lazy. simple_smile

lread21:01:15

Maybe I’ll spend some time looking at those failures… after I finish my current maintenance sweep.

borkdude21:01:20

I put the blame on me: my name is borkdude for a reason, my code is full of weirdness.

😄 1
borkdude21:01:30

and that's why I need clj-kondo 😏

🔥 1
❤️ 1
lread21:01:57

Ha! What one person calls “weirdness” another might call “sophistication”. Or “delightful eccentricity”.

lread21:01:17

Love dat clj-kondo! Such a good and patient friend.

borkdude21:01:41

btw one neat idea for cljdoc might also be to browse to projects using the library, does it also index on that level?

borkdude21:01:05

I've been thinking of building that myself with clj-kondo + asami or so, but it might fit in cljdoc as well

borkdude21:01:47

like: this function is used in these 10 projects over here, with github links to them or so

borkdude21:01:11

the clj-kondo analysis already has that data, just saying :) just need to store it all in a db

lread21:01:16

Currently cljdoc only collects and stores documented APIs.

lread21:01:30

Reminds me of that cool Clojure cross reference web site that… no longer exists.

borkdude21:01:23

yeah, exactly, it shouldn't be too hard to make, just takes work

lread21:01:04

Sounds interesting, would be neat if we could somehow integrate with cljdoc… if it were a good fit.

borkdude21:01:15

@lee btw, I didn't wanted to come across too negative, I appreciate all the hard work you're doing on cljdoc and I do use the site myself for other projects that it doesn't crash on :)

lread22:01:11

The nice thing about being forgetful is that I don’t remember these things, but yeah, there are certainly rough edges that could use love.

lread22:01:47

And no offense taken, the tears were mostly for comedic effect.

😅 1
borkdude22:01:40

well, I know personally that it can be depressing to hear that, after you've poured a lot of hours into a project, someone just discards it, that's certainly not my intention. cljdoc is an amazing project, when it does work out of the box and for many projects it "just works" ™️

borkdude22:01:09

just wanted to set that straight :)

lread22:01:15

Yeah, good point, I in no way felt that burn at all today, but I’ve certainly felt it in the past. Not a nice feeling. Have walked away from some efforts that I might have otherwise continued with because of it.

lread22:01:49

A rare thing, I think, in the Clojure community.

borkdude22:01:43

You're an awesome contributor, glad to be working with you every so often

lread22:01:29

Thanks, ditto! It’s all fun and games until I get totally distracted by the next thing!

borkdude20:01:23

maybe cljdoc could fall back on clj-kondo analysis then ;) /cc @lee

lread21:01:58

Yeah, I’ve been toiling away at various cljdoc maintenance tasks for last little while. Clj-kondo analysis has certainly crossed my mind more than a few times. simple_smile