Skip to content

Instantly share code, notes, and snippets.

View hydrargyrum's full-sized avatar

hydrargyrum

View GitHub Profile
@xkikeg
xkikeg / zshhist.py
Last active May 21, 2024 02:02
Convert ZSH history file (.zsh_history file) between original weird encoding and proper UTF-8.
#!/usr/bin/env python3
"""
ZSH history convert script.
When you mistakenly type your password or quite bad command into ZSH,
you may want to remove the entry from the history.
The problem is, the .zsh_history is encoded in a weird format!
If you want to find a command with non-ASCII character, it'll be problematic.
@namuan
namuan / floating_button_widget.py
Created January 2, 2020 10:25
PyQt5 Floating button on top of QPlainTextEdit
import sys
from PyQt5 import QtCore
from PyQt5 import QtWidgets
class FloatingButtonWidget(QtWidgets.QPushButton):
def __init__(self, parent):
super().__init__(parent)