Skip to content

Instantly share code, notes, and snippets.

@terenty-rezman
terenty-rezman / scrollbar.py
Last active July 2, 2020 18:26
QScrollBar over content
# to have fancy transparent scrollbars over your content
# all you need is to adjust viewport margins with negative values like this:
# scroll_area = QScrollArea()
scroll_area.setViewportMargins(0, 0, -8, -8)
# also here are some styles to make your scrolbars even fancier:
QScrollBar:vertical {
border: none;
background-color: transparent;
@zicklag
zicklag / Cargo.toml
Created February 1, 2020 19:28
Example of using rust-peg parser and chic error messages
[package]
name = "parserator"
version = "0.1.0"
authors = ["Zicklag"]
edition = "2018"
[dependencies]
peg = "0.6.1"
anyhow = "1.0.26"
chic = "1.2.2"
@mtds
mtds / lvn.md
Last active April 18, 2024 07:27
Linux Virtual Networking

Virtual Networking on Linux

In the Linux Kernel, support for networking hardware and the methods to interact with these devices is standardized by the socket API:

                +----------------+
                |   Socket API   |
                +-------+--------+
                        |
User space              |
@brutella
brutella / rpi-enable-camera-module.md
Last active February 9, 2024 09:48
How to enable the camera module on a Raspberry Pi

Enable camera module

Edit your /boot/config.txt file and make sure the following lines look like this:

start_x=1             # essential
gpu_mem=128           # at least, or maybe more if you wish
disable_camera_led=1  # optional, if you don't want the led to glow

Load bcm2835-v4l2 module

@vxgmichel
vxgmichel / aioudp.py
Last active February 15, 2024 00:12
High-level UDP endpoints for asyncio
"""Provide high-level UDP endpoints for asyncio.
Example:
async def main():
# Create a local UDP enpoint
local = await open_local_endpoint('localhost', 8888)
# Create a remote UDP enpoint, pointing to the first one