This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-11
Channels
- # announcements (13)
- # babashka (13)
- # babashka-sci-dev (2)
- # beginners (80)
- # clerk (11)
- # clj-commons (4)
- # cljs-dev (1)
- # cljsrn (1)
- # clojars (19)
- # clojure (48)
- # clojure-austin (2)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (26)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-hungary (32)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # community-development (7)
- # datomic (15)
- # emacs (6)
- # fulcro (2)
- # gratitude (1)
- # hoplon (3)
- # hyperfiddle (28)
- # inf-clojure (14)
- # introduce-yourself (1)
- # jobs (1)
- # joyride (4)
- # lsp (50)
- # malli (4)
- # nrepl (2)
- # polylith (12)
- # shadow-cljs (27)
- # spacemacs (3)
- # sql (8)
- # tools-build (11)
- # xtdb (22)
Hello, I am converting a shell script to babashka, and one line containing a grep | some awk command | sort | uniq
chained together kept me wondering how to handle the newlines properly.
The output is coming from a babashka/process
as a string. I am using clojure.string/split-lines
, which deletes the terminating newline characters. Due to that, I need to put them back when assembling the string back again.
This is what I am experimenting right now:
(net.cgrand.xforms/str
(comp
(filter #(re-find #"test" %))
;; awk related code
(x/sort)
(distinct)
(map #(str % "\n")))
(string/split-lines "testline1\nsome-other-line\nthis is a test again"))
which gets the job done, but I was wondering if there is a better way that does not involve juggling with newline characters.Is there anyone going to the conj who I could order some stickers for so they can give it to people over there? I'm afraid it's going to be too short on time (and I'm terrible with making plans) but maybe someone near me is going there so I can actually ship them this week.
Could you order them online for the US and have them delivered to the hotel for someone who would be staying there?
Didn't realise babashka
wasn't promesa
compatible. Had planned to use a papillon fork that I did to get some context flowing between jobs. ... ๐งต
What are people using to get interceptors into bb
not wedded to an http request response model?
I think promesa could maybe be made bb compatible but due to deftype
+ JVM interfaces it currently isn't
Given I don't need async for the bb
use case, I will just string interceptors together to get this done with no wrapping execute
. However, I now have a reflex to reach for an interceptor library for such things and so I felt compelled to write the question. FYI my fork will hopefully soon be obsolete https://github.com/lambda-toolshed/papillon/issues/2
Nothing further required for now ๐
Babashka reaches 3300 stars on Github! โญ โญ https://github.com/babashka/babashka/stargazers And almost 1300 of you over here! ๐