This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-15
Channels
- # announcements (3)
- # aws (2)
- # babashka (57)
- # beginners (24)
- # clj-kondo (5)
- # clj-together (3)
- # cljs-dev (11)
- # clojure (83)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (32)
- # clojure-filipino (1)
- # clojure-hk (5)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-sg (1)
- # clojure-spain (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # clojurescript (7)
- # conjure (36)
- # data-science (19)
- # datomic (27)
- # emacs (44)
- # events (4)
- # fulcro (16)
- # honeysql (6)
- # inf-clojure (1)
- # interop (5)
- # malli (5)
- # nbb (1)
- # off-topic (19)
- # pathom (4)
- # practicalli (1)
- # remote-jobs (4)
- # ring (1)
- # shadow-cljs (72)
- # spacemacs (2)
For https://github.com/borkdude/deps.clj, if I use it in a normal clj (not bb) project. When I run clojure -Sdeps
will it invoke a subprocess or running inside the current process? Also, why the package name is borkdude.deps and not babashka.deps?
Sounds like the lib is not meant to be used as a library, but instead as a standalone process.
This project is exactly what it says what it is: the clj bash script rewritten in Clojure. The bash script invokes a Java process to calculate the classpath. But it also caches the classpath, so the second time it won't.
It's “borkdude” because everything including babashka started under borkdude. Some repos were moved and some weren't.
This project started as a babashka script but later on it turned out to be useful within bb itself
To get scittle.nrepl to work with ClojureJVM I had to add nrepl/bencode {:mvn/version "1.1.0"}
to my deps.edn
. Am I doing something wrong?
I think you're correct. I only tested this by running the server in bb, which also works but there nrepl/bencode is included
Done 🙂
Updated tweet link here: https://twitter.com/borkdude/status/1547912740156583936
Just in time for the deref 😄 https://clojure.org/news/2022/07/15/deref#_libraries_and_tools
Nice. Just 2 days ago I borrowed your blog back end to start my own. Much better this way than being on a fork! BTW, I just noticed that in the generated .xml files, you've hard coded your own name as author! 🙂
no.horse git:(master) grep -r Michiel
./public/planetclojure.xml: <name>Michiel Borkent</name>
./public/atom.xml: <name>Michiel Borkent</name>
Quick quickblog question. How are you injecting
watch-script "<script type=\"text/javascript\" src=\"\"></script>"
(https://github.com/borkdude/quickblog/blob/1f1346d77a319976dfe6fa6de0ff62f2f5805c8b/src/quickblog/api.clj#L235)
into the rendered HTML? I'm loosing track of where watch-script
is being used.
Does the https://github.com/borkdude/quickblog/blob/1f1346d77a319976dfe6fa6de0ff62f2f5805c8b/src/quickblog/api.clj#L169 render differently depending on whether it's being used to produce live-reloading local output or final HTML render?@U3X7174KS It's injected here during the function watch
Writing an EDN filter with bb is super easy:
echo '{:args [1 2]}' | bb '(assoc *input* :sum (reduce + (:args *input*)))'
{:args [1 2], :sum 3}
Is the best way to write a JSON filter with bb with jet
?
echo '{"args": [1, 2]}' | jet --from json | bb '(assoc *input* :sum (reduce + (:args *input*)))' | jet --to json
{"args":[1,2],"sum":0}
I was kind of curious if there was some kind of --json
flag for babashka to use JSON for IO instead of EDN - https://book.babashka.org/#_input_and_output_flags
$ echo '{"args": [1, 2]}' | jet --from json --keywordize --to json -T '(as-> $ (assoc $ :sum (reduce + (:args $))))'
{
"args" : [ 1, 2 ],
"sum" : 3
}
A cleaner solution:
$ echo '{"args": [1, 2]}' | jet -i json -o json -k -f '#(assoc % :sum (reduce + (:args %)))'
Yes, also SCIbabashka.fs/glob does not find files which are symlinks
the symlink is a named file in the unix abstraction, it is weird to me that if the glob name filter matches, that glob wouldn't include the symlink path in its results, and leave the user to decide what to do with the link.
I tried using :follow-links true as well, but from inspecting the source and the behavior, that is about following a link to continuing recursing below a linked directory
hmm - i'm not sure how to repro
it's clearly happening in my non-trivial case, but when i try to create a trivial case, it works fine
i tried that - that works too
it's a deeper tree, but that's the only difference
(that i can see)
ls shows the file with the same pattern glob does - it isn't even a recursive pattern, it looks like this:
ls */foo/bar/baz*.clj
(linking config files instead of having them in situ, and the glob pattern isn't finding the ones that are linked. it's baffling given that the repro is working fine)
well, instrumenting the fs library helped, thanks for the suggestion. it was actually one layer up, the conversion from a unixpath result to a http://clojure.java.io/file (through an extra call to .getCanonicalPath, natch) was replacing the path with the symlink target path. unexpected, but not babashka.fs's fault 😆 this is why you always ask for a repro ✅
yeah, pebkac
thanks for the suggestions on debugging
Want to transform Markdown, Org-mode, Asciitext, HTML or even EPUB wth Clojure?
It turns out that Babashka and clojure.walk
is an excellent choice for writing Pandoc filters.
Here's a writeup: https://play.teod.eu/document-transform-pandoc-clojure/
Cool stuff :) Also post to #news-and-articles? I think we should also revive: https://github.com/babashka/babashka/blob/master/doc/news.md But surely you can already add it here too: https://github.com/babashka/babashka#articles-podcasts-and-videos
You could simplify the bash wrapper by doing the JSON reading in bb itself, using cheshire
I forgot to update the news.md page in the babashka repo, but I'm picking back up now. https://github.com/babashka/babashka/blob/master/doc/news.md If anyone wants to help backfill news items from previous months, check out the #babashka hashtag on Twitter: I usually share all new projects and tidbits there (among other noise I make about my own work in progress stuff, sorry) PRs welcome
Now backfilled January 2022: https://github.com/babashka/babashka/blob/master/doc/news.md#2022-01 Will post other months in thread to this message.
OK done now. All up to date: https://github.com/babashka/babashka/blob/master/doc/news.md cc @U088NU894
@U04V15CAJ Thank you!