Skip to content

Instantly share code, notes, and snippets.

// License by: AGPL-3.0
let buttonText = 'Show more';
let loadTimeOut = 1000;
document.getElementsByClassName('saleitembrowser_SaleItemBrowserHeader_26iQ9 Panel Focusable')[0].scrollIntoView();
function findButton() {
Array.from(document.getElementsByClassName('Focusable')).forEach(element => {
if (element.textContent !== undefined && element.textContent == buttonText) {
element.click();
console.log('clicked');
}
@KunoiSayami
KunoiSayami / mp42webm.py
Last active February 10, 2022 13:15
Quick transform mp4 to webm for telegram sticker
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2022 KunoiSayami
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# Generated by Powerlevel10k configuration wizard on 2021-11-20 at 22:21 UTC.
# Based on romkatv/powerlevel10k/config/p10k-lean-8colors.zsh, checksum 27244.
# Wizard options: nerdfont-complete + powerline, small icons, lean_8colors, ascii,
# 24h time, 1 line, compact, concise, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with 8-color lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
/* ==UserStyle==
@name Block sina open app bottom
@version 20211014.10.35
@namespace userstyles.world/user/kunoisayami
@description Block sina zx require open app to view more information.
@author kunoisayami
@license AGPLv3
@homepageURL https://gist.github.com/KunoiSayami/ea9d533fc1ecb50c96d0e750a0aa34d2
@supportURL https://gist.github.com/KunoiSayami/ea9d533fc1ecb50c96d0e750a0aa34d2
@preprocessor stylus
/* ==UserStyle==
@name Select code on CSDN without login
@namespace https://github.com/KunoiSayami
@version 1.0.0
@description You can select code on CSDN, but without to login.
@author KunoiSayami
@license AGPLv3
@homepageURL https://gist.github.com/KunoiSayami/543bb1d1424931851842c7ceb7e01b72
@supportURL https://gist.github.com/KunoiSayami/543bb1d1424931851842c7ceb7e01b72
@preprocessor stylus
@KunoiSayami
KunoiSayami / teamspeak.service
Last active July 16, 2021 14:53
Teamspeak systemd file
[Unit]
Description=TeamSpeak Daemon
Requires=network.target
After=network-online.target
[Service]
Type=simple
User=teamspeak
ExecStart=/opt/teamspeak/teamspeak3-server_linux_amd64/ts3server
WorkingDirectory=/opt/teamspeak/teamspeak3-server_linux_amd64
# Try to find the GMP library
# https://gmplib.org/
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(GMP 6.0.0)
# to require version 6.0.0 to newer of GMP.
#
# Once done this will define
#
# GMP_FOUND - system has GMP lib with correct version
@KunoiSayami
KunoiSayami / jupyter-lab.service
Created October 13, 2020 17:15
Systemd file for jupyter lab
; Works on Arch Linux 5.8.14-arch1-1
[Unit]
Description=Jupyter lab
[Service]
Type=simple
ExecStart=/usr/bin/jupyter-lab --ip 0.0.0.0 --port 9090
ExecStop=sh -c 'kill -2 $MAINPID && kill -2 $MAINPID && tail --pid=$MAINPID -f /dev/null'
WorkingDirectory=/home/user/notebook
User=user
# -*- coding: utf-8 -*-
from dataclasses import dataclass
from typing import NoReturn
import bs4
import requests
@dataclass
class UserStatus:
# -*- coding: utf-8 -*-
import subprocess
import os
from typing import NoReturn
def walksdir(_dir: str='.') -> NoReturn:
for root, dirs, _ in os.walk(_dir):
#print(dirs)
for x in dirs:
subp = subprocess.Popen(['du', '-sh', x], stdout=subprocess.PIPE)