-
direct_copy direct copy using language standard library
-
shell_copy direct copy using shell copy command
-
sha1_diff calculate sha1 hashes of both files using language standard library
-
shell_sha1_diff calculate sha1 hashes of both files using
/usr/bin/sha1sum
-
shell_diff using diff programs like GNU diff or git-diff to determine difference
-
read_and_compare_whole read files as a whole and compare in-memory
-
read_and_compare_chunk read chunks of files and compare in-memory until differ or end
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
function isInternalLink(href) { | |
try { | |
/* full URL i.e. has protocol */ | |
let url = new URL(href) | |
return url.origin === window.location.origin | |
} catch { | |
return !href.startsWith('//') || | |
(href.startsWith('//') && (window.location.protocol + href).startsWith(window.location.origin)) | |
} | |
} |
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 [multiRequest, makeRequestFunc] = (() => { | |
let globalRequestPool = [], | |
globalProcessingPool = [], | |
globalMaxConcurrentRequests = 5, /* Give it a default */ | |
globalRequestFunc = null, | |
globalProcessPoolFunc = null | |
type RequestOptions = { | |
isGlobal: boolean, | |
requestFunc: Function |
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
function promiseAll(promises) { | |
return new Promise((resolve, reject) => { | |
let results = [], | |
position = 0, | |
fulfilled = 0, | |
resolved = false | |
for(let promise of promises) { | |
let promisePosition = position | |
if(promise instanceof Promise) { | |
promise.then(value => { |
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
// Main site, https://scp-wiki.wikidot.com | |
[...document.querySelectorAll('.feature-block .content-panel')].map(p => ({ | |
feature: p.querySelector('.panel-heading').textContent.trim(), | |
title: p.querySelector('h4').textContent.trim(), | |
url: p.querySelector('h4 a').href, | |
authors: [...p.querySelectorAll('.printuser a')].map(a => ({ | |
name: a.textContent.trim(), | |
url: a.href | |
})), | |
featuredBy: p.querySelector('.panel-footer').textContent.trim().replace('Featured by ', '').replace(/and /g, '').split(', ') |
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
#C Generated by copy.sh/life | |
x = 10, y = 10, rule = B3/S23 | |
5bo2bo$3b5o$3bobo$b2o2bo$o3bob2obo$2bo2b2ob2o$o4bo3bo$4b2ob3o$3o4bo$2o | |
bob2o! |
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
// ==UserScript== | |
// @name 苹果园 HTTPS 化脚本 | |
// @description 将页面内所有链接和表单的指向改为 HTTPS,保证全站升级到 HTTPS 前的安全性 | |
// @match https://www.goddessfantasy.net/* | |
// @match http://www.goddessfantasy.net/* | |
// @version 0.1.3 | |
// @updateURL https://gist.github.com/nc7s/4d8782b75dce60e2a6110afc8997604a/raw/goddessfantasy-https.user.js | |
// @downloadURL https://gist.github.com/nc7s/4d8782b75dce60e2a6110afc8997604a/raw/goddessfantasy-https.user.js | |
// ==/UserScript== |