This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-16
Channels
- # babashka (53)
- # beginners (61)
- # biff (2)
- # cherry (15)
- # cider (28)
- # clj-kondo (17)
- # clojure (57)
- # clojure-europe (27)
- # clojure-nl (13)
- # clojure-norway (6)
- # clojure-uk (4)
- # clojurescript (30)
- # core-async (2)
- # data-science (39)
- # datomic (16)
- # docker (34)
- # emacs (4)
- # events (1)
- # figwheel-main (9)
- # guix (5)
- # hiccdown (2)
- # honeysql (5)
- # hyperfiddle (5)
- # interceptors (1)
- # jobs (2)
- # joyride (5)
- # lsp (36)
- # midje (1)
- # minimallist (1)
- # nbb (21)
- # off-topic (45)
- # polylith (42)
- # rum (1)
- # shadow-cljs (24)
- # sql (1)
- # squint (62)
- # vrac (1)
- # xtdb (6)
Hi people, Does someone maybe use Clojure Extras plugin in IntelliJ and if so, how are you doing inline evaluation, mine doesn't work..
I ask because the plugin doesn't add keymaps by default, you have to setup your own, based on the options in the tools menu
Hey No error is showing, I just dont know how to evaluate inline, it always evaluates inside repl Is there a different command for it? @UQTHDKJ8J
I don't know how to set it up š
a botched upgrade to Ubuntu 2022.04 that left my networking capabilities in ruins has me thinking:
the amount of absurd lore you have to know to figure out where the "canonical" location of a symlinked .conf
file is depending on the version of your OS and the services you have enabled is the epitome of place-oriented programming
i ran into similar issues earlier this year trying to upgrade to pop os 22.04
my comfort in knowing it's not just me is outweighed by the sorrow in knowing that others have suffered the same fate
My upgrade from 18.04 to 22.04 a month ago went off without a hitch š Don't know if that helps or rubs salt into the wound.
@UEENNMX0T out of curiosity, was it systemd
related? I'm wondering if I'm being affected by https://github.com/systemd/systemd/issues/13432, as I seem to be observing similar logs to those described there.
i had an issue with some graphical driver where two or three times a day, my display would lock up and would be unrecoverable
had to dig into the bowels of some config file to change something or other to work with my monitor, as it's a 4k monitor
> the amount of absurd lore you have to know to figure out where the ācanonicalā location of a symlinked .conf
file
⦠is the reason why, in 2018, after using Ubuntu since the Warty Warthog, I finally said goodbye to that god-forsaken distro and switched to Arch. In the good old days, every 6 months a dist-upgrade would break my X11. Every time. And Iād have to go find another computer (my ācell phoneā didnāt have full internet yet) and get on IRC for āhow fix X this timeā. I finally ignored everyone who said Arch was only for wizards. Everything is where it should be (where the package vendor intended) on Arch, and the wiki is phenomenal.
Or, perhaps, William, this is evidence that you are now a wizard š
Well you know what they say, sufficiently advanced manpage reading is indistinguishable.
Pretty much every release Iāve been a part of in the last three years has been problematic due to invalid configuration options we had no way of verifying until we were in production.
Arch is great. Was my first experience with Linux and I haven't found anything better yet.
I'm a fan of openSuse. Tumbleweed rolling release, never had a single update cause me issues.
can confirm that @U03JPRPTSTX is a wizard
he even has the hat
i'm kinda thinking about arch and/or nix. Im leaning towards Arch. Though, i really feel like there is no way to know without investing a metric shit loads of time and i'm worried in the end ill just have grey hair and different set of issues then i have on ubuntu.
you could try manjaro?
Thanks, yeah. Manjaro is more my speed then arch given what i recall.
https://manjarno.snorlax.sh/ saw this recently
woah thanks, i hadnāt seen that before. iāve only used manjaro on a media laptop for hooking to a projector, never for a serious install, so i didnāt run into any of those issues, but now that iām aware of them iām a little more reserved to recommend it over straight arch.
No problem. I think people overestimate how hard it is to run Arch (unless you don't have a second device that can connect to the internet).
ooooh arch has an installer now
Bash question: I want to write a script that accepts input via STDIN, and routes that both to fzf and to the preview command of fzf
I've tried to do this by writing to a temporary file, but I'm struggling even with that
If what you're taking from stdin is bounded (ie non-infinite) you can usually store it in a variable and just use it where you need it
#!/usr/bin/env sh
TEMP="$(mktemp)"
tee "$TEMP" | fzf --search "[email protected]";
other-command < "$TEMP"
can you use a fifo?
mkfifo, I mean. you could tee to a fifo and stdout, then in the preview command read from the fifo
#!/usr/bin/env bash
set -eux
FIFO_DIR="$(mktemp -d)"
FIFO="$FIFO_DIR/myfifo"
mkfifo "$FIFO"
clean_up() {
# I don't want rm -r "$FIFO_DIR" because I'm paranoid
rm "$FIFO"
rmdir "$FIFO_DIR"
}
trap clean_up EXIT
tee -a "$FIFO" | fzf --preview "cat \"$FIFO\" | other-command --query {q}"
You could also read stdin to a string and pass that string to both places you need it. https://dev.to/jeremyckahn/til-reading-stdin-to-a-bash-variable-1kln
@U4YGF4NGM sounds like tee
is your friend in this case.
> a script that accepts input via STDIN, and routes that both to fzf and to the preview command of fzf
This translates directly to:
do_the_fzf_thing() {
tee >(fzf > /tmp/file) |
tee >(fzf --preview > /tmp/file2) |
# maybe more processing?
other-command
}
echo "input for les fzfs" | do_the_fzf_thing
tee
is great, because one can do things like this pipeline that https://www.evalapply.org/posts/shell-aint-a-bad-place-to-fp-part-1-doug-mcilroys-pipeline/#compose-again-semantics-functions-play-grand-new-pipeline:
# I assume you have Bash version 4+.
man bash |
# pre-process
flatten_paragraphs |
tokenise_lowercase |
drop_stopwords |
# cache raw pre-processed data, if we need to re-analyse later
tee /tmp/bash_manpage_raw_tokens.txt |
# cache various views or compressions of the raw data
tee >(sort_dictionary | uniq > /tmp/bash_manpage_sorted_as_dictionary.txt) |
tee >(sort_rhyme | uniq > /tmp/bash_manpage_sorted_as_rhyme.txt) |
# accumulate various analyses of the OG raw data
tee >(frequencies > /tmp/bash_manpage_token_freqs.txt) |
tee >(bigram | frequencies > /tmp/bash_manpage_bigram_freqs.txt) |
tee >(trigram | frequencies > /tmp/bash_manpage_trigram_freqs.txt) |
take_n
And as Cora pointed out, named pipes may help too.
The guts of the trigram
function that features in the pipeline above, illustrates (maybe too clever and tricksy) but interesting use of named pipes...
trigram() {
# we need intermediate state, but we can make it stream,
# instead of accumulating in temp files
mkfifo trigram_buffer_one trigram_buffer_two
tee >(tail +2 > trigram_buffer_one) |
tee >(tail +3 > trigram_buffer_two) |
paste - trigram_buffer_one trigram_buffer_two |
# take all but the last 2 entries as they are not trigrams
butlast_n 2
rm trigram_buffer_one trigram_buffer_two
}
using a temporary file
#!/usr/bin/env bash
tmpf=$(mktemp)
# pipe STDIN to temporary file
exec 3>"$tmpf"
cat >&3
./eql --keys < tmpf | # use temporary file as input to generate suggestions
fzf --print-query --preview "cat $tmpf | ./eql --query {q}" # pipe temporary file as input to the preview to query on
Ah ok, I completely misunderstood your original question. I think one can eliminate the temp file (and the associated redirect of STDIN), this way:
./eql --keys | # assuming eql accepts its input from STDIN
while read -r suggestion; do fzf --print-query --preview "$(./eql --query \{${suggestion}\})"; done