Skip to content

Instantly share code, notes, and snippets.

View UnluckyNinja's full-sized avatar
🙁
😢

UnluckyNinja UnluckyNinja

🙁
😢
View GitHub Profile
@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
ADMIN_EMAIL=pontoon@example.com
# 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 January 30, 2024 10:49
让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
@Grab(group='commons-io', module='commons-io', version='2.4')
import org.apache.commons.io.FilenameUtils
// bear, dog, lion seem not work
def icons = ['alligator', 'anteater', 'armadillo', 'auroch', 'axolotl', 'badger', 'bat', 'bear', 'beaver', 'buffalo', 'camel', 'capybara', 'chameleon', 'cheetah', 'chinchilla', 'chipmunk', 'chupacabra', 'cormorant', 'coyote', 'crow', 'dingo', 'dinosaur', 'dog', 'dolphin', 'duck', 'elephant', 'ferret', 'fox', 'frog', 'giraffe', 'gopher', 'grizzly', 'hedgehog', 'hippo', 'hyena', 'ibex', 'ifrit', 'iguana', 'jackal', 'kangaroo', 'koala', 'kraken', 'lemur', 'leopard', 'liger', 'lion', 'llama', 'slow loris', 'manatee', 'mink', 'monkey', 'moose', 'narwhal', 'nyan cat', 'orangutan', 'otter', 'panda', 'penguin', 'platypus', 'pumpkin', 'python', 'quagga', 'rabbit', 'raccoon', 'rhino', 'sheep', 'shrew', 'skunk', 'squirrel', 'tiger', 'turtle', 'walrus', 'wolf', 'wolverine', 'wombat']
def url = 'https://ssl.gstatic.com/docs/common/profile/$$_lg.png'
def urls = icons.collect{
url.r
@Grab(group='commons-io', module='commons-io', version='2.4')
import org.apache.commons.io.FilenameUtils
def icons = ['alligator', 'anteater', 'armadillo', 'auroch', 'axolotl', 'badger', 'bat', 'bear', 'beaver', 'buffalo', 'camel', 'capybara', 'chameleon', 'cheetah', 'chinchilla', 'chipmunk', 'chupacabra', 'cormorant', 'coyote', 'crow', 'dingo', 'dinosaur', 'dog', 'dolphin', 'duck', 'elephant', 'ferret', 'fox', 'frog', 'giraffe', 'gopher', 'grizzly', 'hedgehog', 'hippo', 'hyena', 'ibex', 'ifrit', 'iguana', 'jackal', 'kangaroo', 'koala', 'kraken', 'lemur', 'leopard', 'liger', 'lion', 'llama', 'slow loris', 'manatee', 'mink', 'monkey', 'moose', 'narwhal', 'nyan cat', 'orangutan', 'otter', 'panda', 'penguin', 'platypus', 'pumpkin', 'python', 'quagga', 'rabbit', 'raccoon', 'rhino', 'sheep', 'shrew', 'skunk', 'squirrel', 'tiger', 'turtle', 'walrus', 'wolf', 'wolverine', 'wombat']
def url = 'https://ssl.gstatic.com/docs/common/profile/$$_lg.png'
def urls = icons.collect{
url.replace('$$',it.replace(' ','')).