Skip to content

Instantly share code, notes, and snippets.

View mnixry's full-sized avatar
😴
Sleeping

Mix mnixry

😴
Sleeping
View GitHub Profile
@mnixry
mnixry / pixiv-illust-worker.js
Last active July 19, 2021 10:37
Cloudflare worker to get random picture from Pixiv (powered by HibiAPI)
addEventListener("fetch", (event) => {
event.respondWith(
handleRequest(event.request).catch(
(err) =>
new Response(err.stack, {
status: 500,
})
)
);
});
@mnixry
mnixry / qq-avatar-worker.js
Last active July 19, 2021 10:35
A Cloudflare worker to get QQ group or user avatar without site refer protection
addEventListener("fetch", (event) => {
event.respondWith(
router(event.request).catch((err) =>
err instanceof HttpError
? err.toResponse()
: new Response(err.stack, { status: 500 })
)
);
});
@mnixry
mnixry / not-see.js
Created August 4, 2021 06:35
Not-See encoder (encode any character to blank string)
/*
Blank character encoder/decoder
A tool to anti-censorship at Bilibili
Original author: https://not-see.pages.dev/
*/
const ALLOWED_BLANKS = [
"\u0020",
"\u3000",
@mnixry
mnixry / crud-base.model.ts
Last active March 6, 2023 16:48
Nest.js CRUD service base class
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Type as ClassType } from '@nestjs/common';
import { ApiProperty } from '@nestjs/swagger';
import { METADATA_FACTORY_NAME } from '@nestjs/swagger/dist/plugin/plugin-constants';
import { BUILT_IN_TYPES } from '@nestjs/swagger/dist/services/constants';
import { Transform, Type } from 'class-transformer';
import { IsEnum, IsOptional, IsPositive, Max } from 'class-validator';
import { Request } from 'express';
import {
IPaginationLinks,
@mnixry
mnixry / qq_message_xml.md
Last active April 4, 2024 05:50 — forked from koukuko/qq_message_xml.md
QQ的XML消息格式整理

QQ的XML消息格式整理

QQ可以使用xml的方式发送消息,以下为了方便描述统称为卡片。

发送方式

通过机器人的API进行发送xml即可,但是如果选择发送xml,那么其他如[image=xxx][@xxx]这些命令就不可使用了。整个消息只有XML。

基本结构

@mnixry
mnixry / marxists-batch-download.js
Last active October 30, 2021 16:49
Chinese Marxists.org PDF books batch download script. (with Tampermonkey)
// ==UserScript==
// @name Marxist downloader
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Downlaod PDF books from Marxists.org Chinese
// @author Mix <mnixry@users.noreply.github.com>
// @match https://www.marxists.org/chinese/pdf/*
// @grant GM_download
// @grant unsafeWindow
// ==/UserScript==
@mnixry
mnixry / nonebot_guild_patch.md
Last active February 13, 2022 14:04
Patch for NoneBot2 (2.0.0a16) QQ guild support
@mnixry
mnixry / cloudflare-worker-blob-patch.ts
Created February 27, 2022 14:44
Polyfill for multipart-form Blob/File read and creation.
import '@ssttevee/cfw-formdata-polyfill';
import * as poly from '@ssttevee/blob-ponyfill';
export const BuiltinBlob = Blob,
BuiltinFile = File,
BuiltinFormData = FormData;
class OverrideFormData extends BuiltinFormData {
public append(name: string, value: string | Blob, filename?: string): void {
const reader = new poly.FileReaderSync();
@mnixry
mnixry / quasar-masonry-demo.vue
Last active May 13, 2023 16:03
A flexible column masonry component for quasar
<template>
<q-slider v-model="cols" :max="6" :min="1"></q-slider>
<div class="column" :class="`masonry-${cols}`">
<div
v-for="(_, index) in new Array(cols).fill(undefined)"
:key="index"
class="flex-break"
/>
<q-card
@mnixry
mnixry / highlight-inactive-member.user.js
Last active February 6, 2023 19:20
Userscript to highlight inactive group members with rainbow color
// ==UserScript==
// @name Highlight inactive group member
// @namespace https://gist.github.com/mnixry/
// @version 0.1
// @description Highlight inactive group members with rainbow color
// @author Mix
// @author yanyongyu
// @match https://qun.qq.com/member.html
// @icon https://www.google.com/s2/favicons?sz=64&domain=qq.com
// @updateURL https://gist.github.com/mnixry/8f77e4fa658170561d6f7197ce7d6340/raw/highlight-inactive-member.user.js