In the middle of the desert you can say anything you want
.. never used it because didn’t find it pleasant to use because no scrolling and clicking as I’m used to, but I can fix this! Google told me I should install synaptics stuff and use synclient
to config it, but..
(21:30:13/11094)~/$ synclient
Couldn't find synaptics properties. No synaptics driver loaded?
Google led me here: x11 - synclient does not find synaptics properties despite Synaptics Touchpad in xinput list - Unix & Linux Stack Exchange
So in fact the “problem” is that touchpads is nowadays handled by
libinput
, not bysynaptics
. This is why xinput still lists the device, but synclient cannot find it.The touchpad properties can also be controlled using xinput, via
xinput list-props
andxinput set-prop
Which works! xinput set-prop $device $propID $value
, where the property id is given in parentheses in xinput list-props
output:
libinput Tapping Drag Enabled Default (330): 1
So I (in case gets reset after restart):
xinput set-prop 15 327 1 #enabled tapping
xinput set-prop 15 312 0 1 0 # scroll through side of touchpad
Interestingly, xinput set-prop 15 312 1 1 0
didn’t work, apparently I have to choose one. (Same for “click methods”)
Now we pray the xorg/synaptics drivers I installed at the beginning don’t mess up everything after restart ^^ I followed this: How to Activate Two-Finger Scrolling in Ubuntu 18.04 LTS
The ArchWiki is excellent as usual. TIL a tap with three fingers is a shortcut for “paste” and you can change/remap that as everything else! Wow.
TODO - play with buttons and three-taps and two-taps and the physical buttons. Also, where does it define that button N is “paste”? And which clipboard are we talking about?
And - I can do it with my usb mouse!
Extremely helpful answer: Revisions to Passing a dictionary to a function as keyword parameters - Stack Overflow
I also really like this approach:
A few extra details that might be helpful to know (questions I had after reading this and went and tested):
- The function can have parameters that are not included in the dictionary
- You can not override a parameter that is already in the dictionary
- The dictionary can not have parameters that aren’t in the function. Examples:
(Connects with my long-forgotten way of ‘after reading something, ask questions, try to find faults, try to find places this isn’t going to work, try to find connections with stuff you already know, try to find contradictions with stuff you already know’ etc., I have to start doing this again)
Main culprit is this code, and changing that value to anything makes life better:
.adg3 .issue-container {
max-width: 1280px;
}
This line toggles between solarized-everything1 and the above snippet for making jira wide again.
config.bind(',c', 'config-cycle content.user_stylesheets "~/.config/qutebrowser/css/solarized-dark-generic.css" "~/.config/qutebrowser/css/jira.css"')
Sadly no automatic per-website-css possible yet, it seems.
alphapapa/solarized-everything-css: A collection of Solarized user-stylesheets for…everything?
Had issues with NoiseTorch microphone not working, fixed by changing the microphone and then back. (…) While I’m at it, updated NoiseTorch, and added this snippet to the polkit config to not-enter passwords: I don’t want to enter my password everytime · lawl/NoiseTorch Wiki
Still exists and still works!
sshfs me@server:/some/folder /my/local/folder -p 12345
umount /my/local/folder
An insecure faster version is: sshfs -o Ciphers=aes128-ctr -o Compression=no me@server:/some/folder /my/local/folder -p 12345
(In my case, most of my lag was from zsh git prompt plugin, removing it made it much faster)
When a monitor stops working, sometimes it is fixed by deactivating/applying/activating/applying in arandr, or doing any changes to it intead of deactivating it. I’ve been changing its resolution, but to maximally preserve the layout, just inverting it (and back) works too!
Nomacs is extremely slow when viewing images located on a remote server, any other viewer works for me. The default one is eog
/ “Eye of Gnome”
tracemalloc
is part of the python standard library!
This snippet from the docs1 has everything:
import linecache
import os
import tracemalloc
def display_top(snapshot, key_type='lineno', limit=10):
snapshot = snapshot.filter_traces((
tracemalloc.Filter(False, "<frozen importlib._bootstrap>"),
tracemalloc.Filter(False, "<unknown>"),
))
top_stats = snapshot.statistics(key_type)
print("Top %s lines" % limit)
for index, stat in enumerate(top_stats[:limit], 1):
frame = stat.traceback[0]
print("#%s: %s:%s: %.1f KiB"
% (index, frame.filename, frame.lineno, stat.size / 1024))
line = linecache.getline(frame.filename, frame.lineno).strip()
if line:
print(' %s' % line)
other = top_stats[limit:]
if other:
size = sum(stat.size for stat in other)
print("%s other: %.1f KiB" % (len(other), size / 1024))
total = sum(stat.size for stat in top_stats)
print("Total allocated size: %.1f KiB" % (total / 1024))
tracemalloc.start()
# ... run your application ...
snapshot = tracemalloc.take_snapshot()
display_top(snapshot)
Added <Shift+Alt+C>
for “commit”, since <Ctrl+K>
doesn’t work (and afaik is not used for anything else).
(<Ctrl+Shift+C>
is still “copy path”)
<Ctrl-Shift-#>
(where ‘#’ is 1-9) adds named bookmarks to lines in the file; <Ctrl-#>
to go there. (It’s logical to make it easier to go to a bookmark than to set one, given that the former should happen more often). Complements nicely ideavim’s m#
bindings.
These bookmarks are global.
In the description of the plugin GoToTabs: Now it’s supported natively through keymap->other->tabs! Can’t get tab 2 to work, but I couldn’t do this with bookmarks either, something is catching that binding before it gets to intellij?
Also in idea you can map numpad numbers - I could remap them for bookmarks.
TODO make a backup of my keymap.
And - there’s TabNumberIndicator, that adds the Alt+# bindings and shows the tab number in the tab! Exactly what I wanted.
<Ctrl+,>
for moving the tab left though MoveTab plugin.EDIT - argh, I knew I needed these Alt+# bindings. TODO change them to Ctrl+Alt+… or similar.
virtualenv-clone
is the package, syntax is 1
python -m clonevirtualenv source/ target/
This is brilliant: collision detection - What is the fastest way to work out 2D bounding box intersection? - Game Development Stack Exchange
return !(r2.left > r1.right
|| r2.right < r1.left
|| r2.top < r1.bottom
|| r2.bottom > r1.top);
The idea is to capture all possible conditions upon which the rectangles will not overlap, and then negate the answer to see if they are overlapped
Originally from here: Rectangle Intersection – Determine if two given rectangles intersect each other or not « Technical Interview Questions
Doing it straight-forwardly would require more conditions.
Surprisingly intuitive and shows once more that when finding the answer is too hard, trying to find the answer to an opposite question might help you out.
Python venv (virual environment) uses wrong version of Python - Stack Overflow:
As an addition to the accepted answer, be also aware that changing the directory name where your venv is located causes using the default python and pip paths of your system, instead of using the venv one.
This explains so much!
To make an existing virtualenv movable not included in the new venv. :( 1
No easy official way, reinstalling is much easier.
To find out where a certain package is installed, pip list -v
.
import os
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
client = WebClient(token=os.environ['SLACK_BOT_TOKEN'])
try:
response = client.chat_postMessage(channel='vision-trainings', text="Hello world!")
assert response["message"]["text"] == "Hello world!"
except SlackApiError as e:
# You will get a SlackApiError if "ok" is False
assert e.response["ok"] is False
assert e.response["error"] # str like 'invalid_auth', 'channel_not_found'
print(f"Got an error: {e.response['error']}")
Find that branch in git log, right click on the file(s) you want, “Apply selected changes”. 2 (“Cherry-pick selected changes” according to Help)
fig = plt.figure(figsize=(20, 15))
ax = plt.subplot(132)
#plt.gcf().tight_layout(rect=[0, 0, 1, 0.90])
plt.gcf().tight_layout()
fig.subplots_adjust(right=0.9)
cbar_ax = fig.add_axes([0.92, 0.10, 0.04, 0.8])
if heatmap is not None:
fig.colorbar(heatmap, cax=cbar_ax)
Shows incoming and outgoing links, useful to look for other places with similar info.