Skip to content

Instantly share code, notes, and snippets.

View CNSeniorious000's full-sized avatar
🫠
exhausted on assignments and exams

Muspi Merol CNSeniorious000

🫠
exhausted on assignments and exams
View GitHub Profile
@CNSeniorious000
CNSeniorious000 / polyfill.js
Last active June 11, 2024 12:13
Memory-safe Polyfill Implementation for `AbortSignal.any`
const registry = new FinalizationRegistry((callback) => void callback());
export function polyfillAbortSignalAny() {
/** @param {AbortSignal[]} signals */
return (signals) => {
// if (AbortSignal.any) {
// return AbortSignal.any(signals);
// }
const controller = new AbortController();
for (const signal of signals) {
# copied from `promplate.prompt.utils`
from functools import cached_property
from inspect import currentframe
class AutoNaming:
def __new__(cls, *args, **kwargs):
obj = super().__new__(cls)
obj._bind_frame()
@CNSeniorious000
CNSeniorious000 / result.html
Last active February 13, 2023 05:15
重载各种运算符,实现用原生的运算符生成树结构,并导出为xml字符串
<html>
<head>
<title>标题</title>
</head>
<body>
<img src="图片地址" alt="图片标题" />
<div>
<p>第0句</p>
<p>第1句</p>
<p>第2句</p>
hello world!