This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import httpx | |
import ipaddress | |
import orjson | |
import re | |
import sys | |
import urllib.parse | |
from datetime import datetime, timezone, timedelta | |
async def hookRaiseForStatus(r: httpx.Response): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import hashlib | |
import os | |
import secrets | |
import requests | |
import typing | |
from Crypto.Cipher import AES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import abc | |
import bs4 | |
import csv | |
import dataclasses | |
import functools | |
import hashlib | |
import lxml.etree | |
import orjson | |
import os | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ChaCha20Poly1305 } = require('./chacha20poly1305.min.js'); | |
const hexToBytes = e => new Uint8Array(e.match(/[0-9a-f]{2}/gi).map(e => parseInt(e, 16))); | |
const bytesToHex = e => Array.from(e).map(e => e.toString(16).padStart(2, 0)).join(''); | |
// Test vectors from: | |
// https://datatracker.ietf.org/doc/html/rfc7539#section-2.8.2 | |
const keyC = hexToBytes('808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f') | |
const nonceC = hexToBytes('070000004041424344454647'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Ed25519 = require('./ed25519.min.js'); | |
const hexToBytes = e => new Uint8Array(e.match(/[0-9a-f]{2}/gi).map(e => parseInt(e, 16))); | |
const bytesToHex = e => Array.from(e).map(e => e.toString(16).padStart(2, 0)).join(''); | |
// Test vectors from: | |
// https://datatracker.ietf.org/doc/html/rfc8032#section-7.1 | |
const privateA = hexToBytes('4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb'); | |
const messageA = hexToBytes('72'); |
NewerOlder