Skip to content

Instantly share code, notes, and snippets.

Avatar
👁️‍🗨️
NaN

牛さん wayou

👁️‍🗨️
NaN
View GitHub Profile
View the c programming language toc
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 Oct 16, 2020
setup emscripten for vscode intelli sense
View emscripten vscode setup.md

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 Jun 24, 2019
using emscripten from docker instead of installing locally
View emscripten.sh
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 Sep 14, 2020
配置 npm 及相关资源访问国内镜像的 npmrc
View .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 Mar 29, 2019
quick initial node projects with license, readme, gitignore,etc
View initial_project.sh
npx license mit > LICENSE && npx gitignore node && npx covgen liuwayong@gmail.com && yarn init -y
@wayou
wayou / .yarnrc
Last active Sep 24, 2020
配置 yarn 使用国内镜像进行安装的 rc 文件,将此文件放到项目根目录使用
View .yarnrc
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 Jan 25, 2019
comment/uncomment batch lines of code in vim
View vim_comment_tip.md

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

View video_playback.user.js
// ==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
View pan.baidu.com.user.js
// ==UserScript==
// @name baidu yun 资源链接
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 自动将google搜索结果页面中百度云盘地址变成可点击的链接,如果链接附近有提取码,在点击时自动复制
// @author You
// @match https://www.google.com/search*
// @grant none
// ==/UserScript==
@wayou
wayou / h5_video_inline.html
Last active Jan 12, 2019
inline play video in h5 video
View h5_video_inline.html
<video
id="video"
width="100%"
preload="auto"
x-webkit-airplay="true"
webkit-playsinline="true"
playsinline="true"
x5-video-player-type="h5"
x5-video-player-fullscreen="true"
src="https://video.c-ctrip.com/videos/u20j0z000000mjvtd0DB6.mp4"
You can’t perform that action at this time.