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
if (!window.__CUSTON_ED__) window.__CUSTON_ED__ = new EyeDropper() | |
window.__CUSTON_ED__.open() | |
.then(({ sRGBHex }) => { | |
console.log('%c ' + `%c ${sRGBHex}`, `background: ${sRGBHex}`, `background: unset`) | |
navigator?.clipboard?.writeText?.(sRGBHex) | |
}) | |
.catch(() => {}) | |
// bookmarklet: javascript:(function()%7Bwindow.__CUSTON_ED__%7C%7C(window.__CUSTON_ED__%3Dnew%20EyeDropper)%2Cwindow.__CUSTON_ED__.open().then((%7BsRGBHex%3Ac%7D)%3D%3E%7Bconsole.log(%60%25c%20%20%25c%20%24%7Bc%7D%60%2C%60background%3A%20%24%7Bc%7D%60%2C%22background%3A%20unset%22)%2Cnavigator%3F.clipboard%3F.writeText%3F.(c)%7D).catch(()%3D%3E%7B%7D)%3B%7D)()%3B |
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 root = Array.from(document.querySelectorAll('*')).find((e) => e.__vue__ || e.__vue_app__); | |
const app = root?.__vue__ || root?.__vue_app__; | |
const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__; | |
if (!app || !devtools) { | |
console.log(`Can't find vue app or devtools`); | |
return 0; | |
} |
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
// 自然合併排序 - Natural Merge Sort | |
function nms(array) { | |
let resArr = cleanData(array) | |
while (resArr.length !== 1) { | |
let tmp = [] | |
for (let i = 0; i < resArr.length; ) { | |
tmp.push(merge(resArr[i++], resArr[i++])) | |
} | |
resArr = tmp | |
} |