This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-15
Channels
- # aleph (24)
- # announcements (8)
- # babashka (27)
- # beginners (55)
- # biff (4)
- # calva (32)
- # cider (5)
- # clj-kondo (11)
- # clojure (59)
- # clojure-android (3)
- # clojure-australia (1)
- # clojure-belgium (6)
- # clojure-dev (21)
- # clojure-europe (26)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojurescript (19)
- # css (1)
- # data-science (10)
- # datahike (17)
- # events (3)
- # figwheel-main (4)
- # honeysql (1)
- # hugsql (5)
- # hyperfiddle (1)
- # jobs (1)
- # leiningen (3)
- # lsp (6)
- # malli (5)
- # meander (4)
- # nbb (6)
- # off-topic (87)
- # pathom (19)
- # portal (2)
- # re-frame (4)
- # reitit (6)
- # releases (1)
- # remote-jobs (3)
- # shadow-cljs (29)
- # sql (8)
- # tools-deps (6)
- # xtdb (7)
Hi! Would y’all know if there’s any libraries for parsing .ics/caldav files that are compatible with babashka? I would like to slurp a public calendar and get a list of events to map over.
If you can't find any for clojure/bb, you could also try https://www.npmjs.com/package/node-ical with #nbb
oh awesome, and thank you for the quick reply! The closest I found so far is the java library caldav4j (https://github.com/caldav4j/caldav4j) Am going to see if it’s possible to include it using a bb.edn
looks like its in java, so wouldnt run in bb without rebuilding bb locally
Infix math in bb:
(babashka.deps/add-deps '{:deps {rm-hull/infix {:mvn/version "0.4.0"}}})
(require
'[infix.core :refer [base-env]]
'[jasentaa.parser :as p :refer [parse-all]]
'[infix.grammar :refer [expression]])
((parse-all expression "1 + 2 * 3") base-env) ;;=> 7
I'm hoping to listen on a unix domain socket from bb - anyone got any experience with this?
@kipz something like this? https://github.com/babashka/babashka.curl#unix-sockets
You can create a TCP listener, but not sure about domain sockets. This requires a certain Java version
This might be a good reason to upgrade bb to JDK 17 (since JDK 11 will be deprecated in GraalVM 23 as well)
We still have to add that specific class, so if you want to make an example in the issue that would be helpful
oh, cool. Didn't realise that re: GraalVM23 and JDK 11. You're after an example of how I might want to create/listen on a unix socket from bb land?
the relevant classes still need to be added to babashka here right? will make an issue
We will have support for this in http-kit in the next release - so this should get a bit easier 🙂
I see you made an issue. Can you please provide an example expression that we can use as a test?
oh that's great. @U04V15CAJ I can write a test but do you want to use the new http-kit feature as the test instead? would be more comprehensive https://github.com/http-kit/http-kit#unix-domain-sockets-udss
In the following code, can anyone explain the difference in output?
(def s "a")
(def r "\"12 \\\"Hello\\\" 34\"")
(defn replace-match [s match r]
(clojure.string/replace s match r))
(println "good:" (replace-match s s r)) => good: "12 \"Hello\" 34"
(println "bad :" (replace-match s (re-pattern s) r)) => bad : "12 "Hello" 34"
the docs for clojure.string/replace say
The replacement is literal (i.e. none of its characters are treated
specially) for all cases above except pattern / string.
... and then goes into more detail about being able to use $n for capture groups and so on. the 'good' case is string/string, and the 'bad' case is pattern/string, which is treated differently as described aboveThank you for the feedback! Sorry to have wasted your time because I didn't read the docs more carefully. It mentions using the function re-quote-replacement
to eliminate the problem I encountered.
the relevant classes still need to be added to babashka here right? will make an issue