In the middle of the desert you can say anything you want
Unfurl | Definition of Unfurl by Merriam-Webster - “expand, extend, fan (out), flare (out), open, outspread, outstretch, spread (out), stretch (out), unfold”
Things I love so far:
das Teufelszeug - appalling/hellish/infernal stuff (heard at work)
I so missed this.
Adding to ~/.inputrc
this line:
set editing-mode vi
makes all readline programs use vi mode, including Python interactive console. Wow.
Alternatively, this apparently works too when typed into python console:
import readline
readline.parse_and_bind("set editing-mode vi")
ardagnir/athame: Full vim for your shell (bash, zsh, gdb, python, etc)
One can install it in place of the usual readline locally or globally.
Installed for zsh, now I can use ci(
bindings again!
In [Day732]({{site.baseurl}}{% link _posts/2021-01-02-day732.markdown %}), I changed my ./vimrc
to utf8 from latin-1, to be able to use the “◦
” symbol to mark trailing spaces.
Well, it broke the vim macros for the link wiki (from [Day 450]({{site.baseurl}}{% link _posts/2020-06-23-day540.markdown %})) :( I had the latin version of the .vimrc backed up, falling back to it for now.
I need to think of a way to save these macros better, because even copypasting them to this dtb didn’t work and I had to do text encoding magic. I think this is exactly the time one should use a proper scripting language like Python, and write another small qutebrowser script that changes the contents of the filled textarea.
link
links to pages, post_url
links directly to posts inside _posts
.
Link to pages:
{%raw%}
{% link _collection/document-name.md %}
{{ site.baseurl }}{% link _collection/document-name.md %}
{{ site.baseurl }}{% link _posts/2019-03-06-post-title.md %}
{{ site.baseurl }}{% link services/index.html %}
{{ site.baseurl }}{% link /assets/documents/pal-codes.pdf %}
{%endraw%}
Links to posts:
{%raw%}
{% post_url 2019-03-06-post-title.md %}
{{ site.baseurl }}{% post_url 2019-03-06-post-title.md %}
{{ site.baseurl }}{% post_url /folder/2019-03-06-post-title.md %}
{%endraw%}
Copied directly from this excellent page, I never found this explained in such a readable way: How to create internal links in Jekyll | Web Island Blog
Write a small script that allows me to easily link to days just by their day number.
Before URI contained the date and was hard to link to. Now I changed this in _config.yml
:
permalink: :title:output_ext
Links are now like this: https://www.pchr8.net/d/dtb/day749.html
float('inf')
works for floats, but there’s no way to do it with int
s. math.inf
is also a float. 1
<Ctrl-C>
Made a typo, vim attempted to indent 20k lines (and started counting “xx lines to indent…”, intuitively pressed <Ctrl-C>
, it successfully interrupted the operation!
Simplified bindings for passthrogh, added last line to ~/.config/qutebrowser/config.py
config.unbind('<Shift-Escape>', mode='passthrough')
config.bind('<Ctrl-Shift-+>', 'leave-mode', mode='passthrough')
config.bind('<Shift-I>', 'enter-mode passthrough')
Would allow me to use websites’ own shortcuts more often.
100 point check - Wikipedia (seen first here: I was a very happy FastMail customer until a hacker asked them to reset my passw… | Hacker News)
dill
is like pickle
, but serializes more stuff!
Yet another way one can get the “no tests to run” error - if a test is not called test_...
, it won’t be ran.
It’s easy to do a sticky window in i3!
Added to ~/.config/i3/config
:
# Sticky window
bindsym $ms+p sticky toggle
Seaborn anonying facet title · Douglas C. Wu:
sns.catplot(x="target",y="score",hue='score-type',data=d,kind='bar',col='bundle',col_wrap=2,sharex=False,sharey=False).set_titles(col_template='{col_name}')
The set_titles(col_template='{col_name}')
removes the usual “x=y” title in each of the sub-plots!
Yet another time qtbrowser started crashing, yet another time fixed it by removing state
and sessions
from ~/.local/share/qutebrowser/
. I blame me messing with qt versions last week.
Somehow magically I don’t have to escape anything in the regexes when using it!
ag "(VISION_|short)" *
python - Passing empty string to argparse - Stack Overflow:
python test.py --mode=
I’ve been using args a la -w is
, but -w=is
also works, and therefore python3 myprogram.py -w -another=opt
is perfectly valid! Python parses it as empty string (that casts to False
).
fc
linux meaningTIL fc stands for “fix command”!
s/
replacing stuffDiscovered that if you just want to remove something, %s/from
works (without the second //
part at all)
Seems the best current default way to do cli options! Docs tutorial is as accessible as usual: Argparse Tutorial — Python 3.9.1 documentation
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) # show default args in help
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter) # allow newlines in help text
parser.add_argument("-lp", "--localpath", help="Local path. \n %(default)s", default=local_path) # add default text in help text manually
When creating argparse.py, don’t be surprised if you can’t use argparse from import argparse
. 1
Nice article: PyFormat: Using % and .format() for great good!
I should make an effort to learn it and use it.
ag -G "component.*yaml" regex
- searches for regex inside all files whose path matches the regex after -G
ag --python "myregex"
automatically looks for it in all python files, and really nicely outputs matches!
g!/pattern/d
, as opposed to the usual g
without exclamation mark.
less
to copy cli stuff with weird linebreaksIf command
returns output with newline breaks that are ignored when copypasting directly, using command | less
seems to make it work - I can copypaste from there without problems.
I wasn’t able to do it the usual amixer
way, because:
You are running Pulseaudio, which uses ALSA to drive soundcards, but which connects to Bluetooth speakers without involving ALSA. When you set ALSA volumes with
amixer
, Pulseaudio notices and corrects the source/sink volumes[…] 1
Command to do it directly through pulseaudio is:
pactl set-sink-volume name_of_bluetooth_speaker +3%
Added this to ~/.config/i3/config:
bindsym Mod1+r exec pactl set-sink-volume bluez_sink.60_AB_D2_43_E9_C5.a2dp_sink +5%
bindsym Mod1+c exec pactl set-sink-volume bluez_sink.60_AB_D2_43_E9_C5.a2dp_sink -5%
<F10>
leaves only the current picture (‘frameless’), a la scrot
; Though in this mode drag-n-drop doesn’t work!Found this when autocompleting something else:
(12:36:26/10136)~/ $ which spectrum_ls
spectrum_ls () {
for code in {000..255}
do
print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
Returns 255 lines with 255 colors, they look neat:
TODO: The Many Ways To Call Axes In Matplotlib | by Jun | Towards Data Science And in general