Skip to content

Instantly share code, notes, and snippets.

View bruceCzK's full-sized avatar

Bruce bruceCzK

View GitHub Profile
@hetykai
hetykai / setNodeMirror.sh
Last active July 7, 2023 02:44
修改node npm yarn的镜像源设置,替换为国内的淘宝源
npm set registry https://registry.npm.taobao.org && \
npm set disturl https://npm.taobao.org/dist && \
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass && \
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ && \
npm set puppeteer_download_host https://storage.googleapis.com.cnpmjs.org && \
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver && \
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs && \
npm set selenium_cdnurl https://npm.taobao.org/mirrors/selenium && \
npm set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector && \
@bruceCzK
bruceCzK / special-escape.js
Last active March 26, 2022 06:10
CK2SpecialEscapeNodeJs
// Ported from https://github.com/matanki-saito/EU4SpecialEscape/blob/master/ConsoleApplication3/ConsoleApplication3.cpp#L235
module.exports = function specialEscape(char, toUtf8, newVersion) {
// DO NOT escape valid char
if (char.codePointAt(0) < 256) {
return char
}
const hex = char.codePointAt(0).toString(16)
// default if UTF8, so hex is 4 length for most letters
// split low byte and high byte
// transform decimal to hex
@52cik
52cik / address.js
Last active June 4, 2022 13:06
提取淘宝地址库
/**
* 提取淘宝地址库
*
* 用法:
* 1. 打开淘宝 https://www.taobao.com/
* 2. 将下面代码复制到控制台
* 3. 按回车
* 4. 复制输出的 json 数据保存到你的文件
*
* 仅支持: chrome 48+
daemon off;
error_log /dev/stdout error;
worker_processes 4;
events {
worker_connections 1024;
}