Skip to content

Instantly share code, notes, and snippets.

@reee
reee / gist:7e5e4b92fcb1dd7c286e5906351b5e72
Created February 7, 2026 04:48
修复WPS在hyprland下主窗口平铺模式下文件操作等对话框显示不正确的问题
# WPS 文件操作等 -> floating|
# 关键在当前版本wps复制粘贴等对话框的title与主窗口class是一致的,因此通过title进行匹配
windowrule {
name = wps-float
match:class = ^(wpsoffice|wps|et|wpp|pdf)$
match:title = ^(另存为.*|打开.*|查找.*|替换.*|定位.*|wpsoffice|wps|et|wpp|pdf)$
float = on
}
import os
import random
import configparser
import pickle
from PyQt6.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QHBoxLayout, QVBoxLayout, QMessageBox, QListWidget, QListWidgetItem
import subprocess
FILEBROWSER_PATH = os.path.join(os.getenv('WINDIR'), 'explorer.exe')
import functools
class MyApp(QWidget):
@reee
reee / randplay.py
Last active July 22, 2023 03:23
open a random file in the dictionary
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import random
import pickle
import configparser
import pyperclip
configParser = configparser.RawConfigParser()
# User authentication method. Could be set multiple times and in
# that case all should succeed. To enable multiple methods use
# multiple auth directives. Available options: certificate,
# plain, pam, radius, gssapi.
#
# Note that authentication methods cannot be changed with reload.
# certificate:
# This indicates that all connecting users must present a certificate.
#
@reee
reee / google-search.py
Created August 27, 2015 02:32
google-search.py
for k in keywords_list:
google_add = random.choice(google_adds_list)
url = make_up_url(google_add, k, False)
if scrape_keyword_count(k, useragent_list, url, result_dir):
keyword_count = scrape_keyword_count(k, useragent_list, url, result_dir)
all_keyword_count.append(keyword_count)
print '%s Finish. Removeing it from the list' % k
keywords_list.remove(k)
else:
print "%s may run into problem, removing it from list" % google_add
@reee
reee / rateat
Last active November 26, 2017 07:47
Redirect All Traffic Except Asia Traffic
#!/bin/sh
#create a new chain named SHADOWSOCKS
iptables -t nat -N SHADOWSOCKS
# Ignore your shadowsocks server's addresses
# It's very IMPORTANT, just be careful.
iptables -t nat -A SHADOWSOCKS -d 163.44.132.189/32 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
@reee
reee / split-and-comp
Created March 24, 2014 05:38
Split a Doc into words and compare with a keywords list
#!/usr/bin/env python
# coding:utf-8
import os
import jieba
# Define where we put the files
source_dictionary = "/opt/ht/source"
keywords_file = "/opt/ht/keywords-new.txt"
result_file = "/opt/ht/result.txt"