Skip to content

Instantly share code, notes, and snippets.

View wayou's full-sized avatar
👁️‍🗨️
NaN

牛さん wayou

👁️‍🗨️
NaN
View GitHub Profile
@wayou
wayou / autocorrect-esm.js
Created April 15, 2025 05:39
autocorrect-esm.js
const A="https://huacnlee.github.io/autocorrect/assets/autocorrect_bg-46190a73.wasm",C=async(e={},n)=>{let o;if(n.startsWith("data:")){const _=n.replace(/^data:.*?base64,/,"");let r;if(typeof Buffer=="function"&&typeof Buffer.from=="function")r=Buffer.from(_,"base64");else if(typeof atob=="function"){const c=atob(_);r=new Uint8Array(c.length);for(let i=0;i<c.length;i++)r[i]=c.charCodeAt(i)}else throw new Error("Cannot decode base64-encoded data URL");o=await WebAssembly.instantiate(r,e)}else{const _=await fetch(n),r=_.headers.get("Content-Type")||"";if("instantiateStreaming"in WebAssembly&&r.startsWith("application/wasm"))o=await WebAssembly.instantiateStreaming(_,e);else{const c=await _.arrayBuffer();o=await WebAssembly.instantiate(c,e)}}return o.instance.exports};let t;function v(e){t=e}const E=typeof TextDecoder>"u"?(0,module.require)("util").TextDecoder:TextDecoder;let x=new E("utf-8",{ignoreBOM:!0,fatal:!0});x.decode();let b=null;function p(){return(b===null||b.byteLength===0)&&(b=new Uint8Array(t.memory
@wayou
wayou / filters.txt
Created October 6, 2021 04:08
ublock 屏蔽知乎视频
www.zhihu.com##[class="ZVideoItem-video"]
www.zhihu.com##[class="VideoAnswerPlayer"]
www.zhihu.com##[class="RichText-ZVideoLinkCardContainer"]
Preface 6
Preface to the first edition 8
Chapter 1 - A Tutorial Introduction 9
1.1 Getting Started 9
1.2 Variables and Arithmetic Expressions 11
1.3 The for statement 15
1.4 Symbolic Constants 17
1.5 Character Input and Output 17
1.5.1 File Copying 18
1.5.2 Character Counting 19
@wayou
wayou / emscripten vscode setup.md
Last active February 13, 2025 03:49
setup emscripten for vscode intelli sense

install emscripten

$ brew install emscripten

and setup by following the instruction after the installation.

get the location of emscripten header files

@wayou
wayou / emscripten.sh
Last active June 24, 2019 10:21
using emscripten from docker instead of installing locally
emcc_image="trzeci/emscripten";
if [[ "$(docker images -q $emcc_image:latest 2> /dev/null)" == "" ]]; then
docker pull emcc_image;
fi
alias emcc="docker run --rm -v "$(pwd):/src" $emcc_image emcc";
# test
emcc -v
@wayou
wayou / .npmrc
Last active January 16, 2025 15:19
配置 npm 及相关资源访问国内镜像的 npmrc
# package-lock=false
registry="https://registry.npm.taobao.org"
disturl="https://npm.taobao.org/dist"
nvm_nodejs_org_mirror="http://npm.taobao.org/mirrors/node"
nodejs_org_mirror="http://npm.taobao.org/mirrors/node"
sass_binary_site="http://npm.taobao.org/mirrors/node-sass"
electron_mirror="http://npm.taobao.org/mirrors/electron/"
SQLITE3_BINARY_SITE="http://npm.taobao.org/mirrors/sqlite3"
profiler_binary_host_mirror="http://npm.taobao.org/mirrors/node-inspector/"
node_inspector_cdnurl="https://npm.taobao.org/mirrors/node-inspector"
@wayou
wayou / initial_project.sh
Created March 29, 2019 09:21
quick initial node projects with license, readme, gitignore,etc
npx license mit > LICENSE && npx gitignore node && npx covgen [email protected] && yarn init -y
@wayou
wayou / .yarnrc
Last active December 16, 2023 11:45
配置 yarn 使用国内镜像进行安装的 rc 文件,将此文件放到项目根目录使用
registry "https://registry.npm.taobao.org"
disturl "https://npm.taobao.org/dist"
nvm_nodejs_org_mirror "http://npm.taobao.org/mirrors/node"
NODEJS_ORG_MIRROR "http://npm.taobao.org/mirrors/node"
sass_binary_site "http://npm.taobao.org/mirrors/node-sass"
electron_mirror "http://npm.taobao.org/mirrors/electron/"
SQLITE3_BINARY_SITE "http://npm.taobao.org/mirrors/sqlite3"
profiler_binary_host_mirror "http://npm.taobao.org/mirrors/node-inspector/"
node_inspector_cdnurl "https://npm.taobao.org/mirrors/node-inspector"
selenium_cdnurl "http://npm.taobao.org/mirrors/selenium"
@wayou
wayou / vim_comment_tip.md
Last active January 25, 2019 05:13
comment/uncomment batch lines of code in vim

comment

  • go to the first line you want to comment
  • control + c enter visual mode
  • navigate to the last line you want to comment
  • shift + i enter edit mode
  • type the comment symbol #,// or whatever
  • press ESC twice to exit

uncomment

// ==UserScript==
// @name set video playback rate
// @namespace http://tampermonkey.net/
// @version 0.1
// @description change the playback rate of the video
// @author wayou
// @match *://pan.baidu.com/*
// @match *://www.zealer.com/*
// @grant unsafeWindow
// @grant GM_addStyle