Skip to content

Instantly share code, notes, and snippets.

@UnluckyNinja
UnluckyNinja / @unocss__vite.patch
Last active November 27, 2024 15:05
Patch is generated with @[email protected]. Put `@unocss__vite.patch` in `./patches` and change package.json and run `pnpm i`
diff --git a/dist/index.mjs b/dist/index.mjs
index 3c21e0e7246b6ecd916df9602e1627a0685ec4b9..fa894e15c78a8b82bf1c3029c600e592ec69bb0b 100644
--- a/dist/index.mjs
+++ b/dist/index.mjs
@@ -361,14 +361,14 @@ const VIRTUAL_ENTRY_ALIAS = [
];
const LAYER_MARK_ALL = "__ALL__";
const RESOLVED_ID_WITH_QUERY_RE = /[/\\]__uno(_.*?)?\.css(\?.*)?$/;
-const RESOLVED_ID_RE = /[/\\]__uno(?:_(.*?))?\.css$/;
+const RESOLVED_ID_RE = /[/\\]__uno(?:_(.*?))?\.css(?=(?:\?.*)?$)/;
// for https://craftinginterpreters.com to re-align aside elements after using a translation service
// copy & paste whole script into a tool like https://chriszarate.github.io/bookmarkleter/
// to make it a convenient bookmarklet
const AVOID_CONFLICT_NAME = '__aside_listeners'
const handles = window[AVOID_CONFLICT_NAME]|| []
handles.forEach(it=>it())
$('aside').each(function(){
const cur = $(this)
let prev = cur.prev();
@UnluckyNinja
UnluckyNinja / ff14_shop_script.js
Created July 19, 2023 16:38
从FF14商城查找对应商品信息
let list = [
]
for (let i = 0; i < list.length; i++){
const name = list[i]
const result = await (await fetch(`https://sqmallservice.u.sdo.com/api/ps/product/list?merchantId=1&page=1&pageSize=40&categoryId=&tagId=&order=0&keyword=${encodeURIComponent(name)}&categoryType=0`, {
"headers": {
"accept": "application/json, text/javascript, */*; q=0.01",
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6,en-GB;q=0.5,ja;q=0.4",
"qu-deploy-platform": "1",
"qu-hardware-platform": "3",
@UnluckyNinja
UnluckyNinja / summersale2022walkthrough.js
Created June 23, 2022 23:16
It goes through each category on current page and highlight result for you.
(async function(){
document.head.insertAdjacentHTML('beforeend',`<style>.waves {animation: shockwave 2s infinite;border-style: solid;border-color: red;position: absolute;border-width: 12px;filter: blur(2px);pointer-events: none;z-index: 100;box-sizing: border-box;}@keyframes shockwave {0% {opacity: 0%;-webkit-transform: scale(130%);transform: scale(130%);}20% {opacity: 80%;}80% {opacity: 80%;}100% {opacity: 0%;-webkit-transform: scale(100%);transform: scale(100%);}}</style>`);
let _$$ = $$
let found = false
let ele
for (let tab of [..._$$('.SaleSectionTabs .SaleTab')]){
tab.click()
await new Promise(res=>setTimeout(()=>res(), 1000))
window.scroll({ top: document.body.scrollHeight, behavior: 'smooth' })
await new Promise(res=>setTimeout(()=>res(), 2000))
@UnluckyNinja
UnluckyNinja / useQueue.ts
Created May 11, 2021 18:07
A simple reactive timed queue that leverage vue 3 and vueuse
import { nextTick, readonly, ref, Ref } from 'vue'
import { until } from '@vueuse/core'
export function timeout(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export const createQueue = (minInterval: number = 0) => {
const queue = [] as { ready: Ref<boolean> }[]
let last = 0
@UnluckyNinja
UnluckyNinja / sina-revoke-vipoauth.js
Created April 1, 2021 02:52
撤销新浪购买vip时,自动授权给vip功能的代发微博权限(升级之类的),打开weibo.com然后F12控制台里粘贴&回车
fetch("https://app.weibo.com/aj_app_revoke.php", {
"credentials": "include",
"headers": {
"accept": "*/*",
"accept-language": "zh-CN,zh;q=0.9",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded",
"pragma": "no-cache",
"x-requested-with": "XMLHttpRequest"
},
@UnluckyNinja
UnluckyNinja / pontoon.env
Created August 22, 2020 13:02
Mozilla should provide a template like these for manual setup
[email protected]
# Optional. Email address for the ADMINS setting.
ADMIN_NAME=pontoon-admin
# Optional. Name for the ADMINS setting.
AUTHENTICATION_METHOD=django
# The default value is django, which allows you to log in via accounts created using manage.py shell. Set to ‘fxa’ if you want to use ‘Firefox Accounts’ (corresponding FXA_* settings must be set). Set to ‘github’ if you want to use ‘GitHub’ (corresponding GITHUB_* settings must be set). Set to ‘gitlab’ if you want to use ‘GitLab’ (corresponding GITLAB_* settings must be set if required). Set to ‘google’ if you want to use ‘Google’ (corresponding GOOGLE_* settings must be set).
CELERY_ALWAYS_EAGER=false
# Controls whether asynchronous tasks (mainly used during sync) are sent to Celery or executed immediately and synchronously. Set this to False on production.
CELERYD_MAX_TASKS_PER_CHILD=20
# Maximum number of tasks a Celery worker process can execute before it’s replaced with a new one. Defaults to 20 tasks.
# verify domain with dns-01 challenge
# and check setup with staging server first
certbot certonly --preferred-challenges dns --manual --dry-run
# then normal server and remember to update dns record
certbot certonly --preferred-challenges dns --manual
@UnluckyNinja
UnluckyNinja / .gitconfig
Last active March 9, 2025 08:37
让git使用clash的socks代理通道
[core]
gitproxy = socks5://127.0.0.1:7890
[http]
postBuffer = 524288000
postBuffer = 524288000
proxy = socks5://127.0.0.1:7890
[https]
postBuffer = 524288000
postBuffer = 524288000
proxy = socks5://127.0.0.1:7890
// ==UserScript==
// @name dmzj 记录
// @namespace wut
// @version 0.1.1
// @description wut
// @copyright 2018, wut
// @run-at document-end
// @author wut
// @match *://i.dmzj.com/subscribe