Skip to content

Instantly share code, notes, and snippets.

View TransparentLC's full-sized avatar
🐟
Touching fish _(:зゝ∠)_

✨小透明・宸✨ TransparentLC

🐟
Touching fish _(:зゝ∠)_
View GitHub Profile
function PartiallyDownload-File([String]$Uri, [String]$OutFile, [Int64]$Start, [Int64]$End = 0, [String]$UserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36') {
[Net.ServicePointManager]::DefaultConnectionLimit = [Int32]::MaxValue
$Request = [Net.WebRequest]::Create($Uri)
if ($End) {
$Request.AddRange($Start, $End)
}
else {
$Request.AddRange($Start)
}
$Request.UserAgent = $UserAgent
@TransparentLC
TransparentLC / qsticker.py
Last active March 8, 2024 23:07
下载手机 QQ 的原创表情,使用方式:qsticker.py --emoticonid 203291 --destination /any/dir --zip
import argparse
import json
import os
import re
import requests
import requests.exceptions
import threading
import zipfile
from requests.models import Response
#!/usr/bin/env pwsh
# https://stackoverflow.com/questions/8761888/capturing-standard-out-and-error-with-start-process
function Start-Command ([String]$Path, [String]$Arguments) {
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $Path
$pinfo.RedirectStandardError = $true
$pinfo.RedirectStandardOutput = $true
$pinfo.UseShellExecute = $false
$pinfo.Arguments = $Arguments
import sys
from PIL import Image
if len(sys.argv) < 2:
print(f'Usage: python3 {sys.argv[0]} /path/to/image [/path/to/output]')
sys.exit(1)
f = sys.stdout if len(sys.argv) < 3 else open(sys.argv[2], 'w', encoding='utf-8')
literal = False
@TransparentLC
TransparentLC / multi-watcher.py
Last active April 23, 2023 01:57
在一些账号有更新时使用 Windows 的通知卡片发送提醒
import abc
import bs4
import csv
import dataclasses
import functools
import hashlib
import lxml.etree
import orjson
import os
import re
import re
import requests
s = requests.Session()
r = s.get('https://moderatecontent.com/')
logid = re.search(r"var log_id = '([\da-f]+)';", r.text).group(1)
# r = s.post(
# 'https://moderatecontent.com/api/upload.php',
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\miniserve]
@="使用 Miniserve 共享文件夹"
[HKEY_CLASSES_ROOT\Directory\Background\shell\miniserve\command]
@="miniserve --hide-theme-selector --dirs-first --enable-tar --enable-tar-gz --enable-zip --show-wget-footer --readme --verbose \"%V\""
@TransparentLC
TransparentLC / transfersh.py
Last active October 10, 2022 04:54
CLI of https://transfer.sh/ with encryption support.
#!/usr/bin/env python3
import argparse
import hashlib
import os
import secrets
import requests
import typing
from Crypto.Cipher import AES
// https://github.com/terser/html-minifier-terser#options-quick-reference
const htmlMinifierConfig = {
collapseWhitespace: true,
collapseBooleanAttributes: true,
decodeEntities: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
removeEmptyAttributes: true,
@TransparentLC
TransparentLC / vscode-powermode-particles.js
Last active February 24, 2022 09:41
Generate animated particle svgs for VSCode extension "vscode-power-mode".
const count = 10;
const size = 5;
const duration = 1000;
const random = (a, b) => Math.random() * (b - a) + a;
let svg = Array(count).fill().map(() => {
const sizeR = Math.round(size * random(.6, 1.2), 2);
const startX = Math.round(100 - size / 2 + size * random(-1, 1), 2);
const startY = Math.round(100 - size / 2 + size * random(-1, 1), 2);