In the middle of the desert you can say anything you want
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
das wasserzeichen - Watermark! (Heard at work) die dringlichkeit - urgency. “Besondere Dringlichkeit”. Verschiedene Dringlichkeiten. (heard at work)
blueman
is a nice semi-gui suite for everything. bluetoothctl
is an interactive cli.
lawl/NoiseTorch: Real-time microphone noise suppression on Linux. - creates virtual devices that are the same as inpucts, but filter the noise. Works really well for me! (Single binary). Works also for filtering voice in outputs! Listening to songs through it is weird.
Changed date
format from %+V
to just %V
, which gives a sprint like 01 instead of 1 (which in turn removes the need for sprint.is:1
filtering in taskwarrior, now sprint:01
is a unique identifier)
~/.zshrc
:
export SPRINT=$(date +%V)
For this, a subset has to become bad values, and a cmap has to set what to do with them.
my_cmap = copy.copy(plt.cm.get_cmap('gray')) # get a copy of the gray color map
my_cmap.set_bad(alpha=0) # set how the colormap handles 'bad' values
plt.imshow(thing, cmap=my_cmap)
As for bad values, I wrote a function similar to this to make them arbitrary:
def get_bad_values(matr, value=0):
new_matr = matr.astype(np.float)
new_matr[new_matr == value] = np.nan
return new_matr
Note that np.nan
can only replace a np.float
, never an int!