Skip to content

Instantly share code, notes, and snippets.

@Zren
Zren / HackerNews.css
Created June 15, 2023 15:51
Stylus theme for news.ycombinator.com and hckrnews.com
@-moz-document domain("hckrnews.com") {
@media (max-width: 767px) {
header > .span5:first-child {
width: 60vw;
}
header h3 {
padding-left: 20px;
}
}
#!/usr/bin/env python3
import argparse
import configparser
import datetime
import glob
import json
import logging
import os
import re
#!/bin/python3
import os
import os.path
import re
import argparse
def formatSplitFilepath(filepath, splitIndex):
splitQtdFormat = filepath.replace('.qtd', '-{}{}.qtd')
assert splitIndex <= 26*26
a1 = chr(ord('a') + (splitIndex // 26))
#!/bin/bash
# To run anywhere with "git lsdir"
# sudo mv ./git-lsdir.sh /usr/local/bin/git-lsdir
# sudo chmod +x /usr/local/bin/git-lsdir
Red='\033[0;31m'
Orange='\033[0;33m'
LightRed='\033[91m'
LightGreen='\033[92m'
Yellow='\033[93m'
@-moz-document domain("hckrnews.com") {
html, body {
color: #c1c2c3; /* #333333 */
background-color: #111213; /* #ffffff */
}
a {
color: #aaaaaa; /* #333333 */
}
a:hover {
local assdraw = require 'mp.assdraw'
local msg = require 'mp.msg'
local opt = require 'mp.options'
local utils = require 'mp.utils'
print("get_script_name: ".. mp.get_script_name())
--
-- Parameters
--
#!/usr/bin/sh
# https://gist.github.com/Zren/d39728991f854c0a5a6a7f7b70d4444a
# Updated: 2022-01-24
### Media Codecs (MP4 / Netflix DRM)
# https://en.opensuse.org/Additional_package_repositories
sudo zypper ar -cfp 90 https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/Essentials packman-essentials
sudo zypper dup --from packman-essentials --allow-vendor-change
### Zren's Apps
@Zren
Zren / QuickTileAppOnStart.js
Last active February 7, 2024 03:44
KWin Scripts
function onClientAdded(client) {
if (client.resourceName == "navigator" && client.resourceClass == "firefox") {
client.activeChanged.connect(function quickTileClientOnFocus(){
workspace.slotWindowQuickTileLeft()
client.activeChanged.disconnect(quickTileClientOnFocus)
})
}
}
workspace.clientAdded.connect(onClientAdded)
import sys
from PyQt5 import QtCore, QtGui, QtWidgets, Qt
from Xlib import X, Xatom
from Xlib.display import Display
from Xlib.error import CatchError, BadAtom
def enable_blur(widget: QtWidgets.QWidget):
ec = CatchError(BadAtom)
display = Display()
print('ec', ec)
function pa_defaultsink_name () { pacmd stat | awk -F": " '/^Default sink name: /{print $2}'; };
function pa_defaultsink_getvolume () { pacmd list-sinks | grep -A10 "$(pa_defaultsink_name)" | grep "volume: front-left:" | sed 's/\tvolume: front-left: // ; s/,\s*front-right:.*//'; };
function pa_defaultsink_setvolume () { pactl set-sink-volume "$(pa_defaultsink_name)" "$1"; pa_defaultsink_getvolume; };
for i in $(seq 0 150); do pa_defaultsink_setvolume "${i}%"; sleep 1; done > ~/Desktop/PAVolumeSteps.txt