Integrates:
The code below displays a single paginated table with a simple filter.
Inspired by this article
""" | |
This is an adjusted version of the official simpletreemodel[1] that adds lazy loading and uses a dict as backend. | |
Instead of the dict it could also use a database or similar. Items are only loaded when expanded, which allows | |
for speedy startup-time, even with 2.5m items. | |
1: https://github.com/baoboa/pyqt5/tree/master/examples/itemviews/simpletreemodel | |
""" | |
import sys |
Integrates:
The code below displays a single paginated table with a simple filter.
Inspired by this article
Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.
Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple
) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic
module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.
Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.
Older Keychron keyboards (those not based on QMK) use the hid_apple
driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.
#!/usr/bin/env bash | |
# rbw git-credential helper | |
# Based on https://github.com/lastpass/lastpass-cli/blob/master/contrib/examples/git-credential-lastpass | |
# A credential helper for git to retrieve usernames and passwords from rbw. | |
# For general usage, see https://git-scm.com/docs/gitcredentials. | |
# Here's a quick version: | |
# 1. Put this somewhere in your path. | |
# 2. git config --global credential.helper rbw |
/^#?([a-f0-9]{6}|[a-f0-9]{3})$/
A Regular expression, or Regex, is a method of validating a specific piece of text by use of a sequence of characters each including their own fundimental principles. Regex can be used to validate emails, hex values, URLs, and HTML. In this case we will be focusing on Hex values which are typically a # with 6 numbers or letters following it.
from typing import Union, List | |
from dataclasses import dataclass | |
class Validations: | |
def __post_init__(self): | |
"""Run validation methods if declared. | |
The validation method can be a simple check | |
that raises ValueError or a transformation to |
import subprocess | |
import re | |
import sys | |
def get_pks_repoquery(): | |
# Use repoquery to create a list of userinstalled packages | |
return set(subprocess.check_output( | |
'dnf repoquery --userinstalled --qf "%{name}"', shell=True, text=True | |
).splitlines()) |