Skip to content

Instantly share code, notes, and snippets.


Wu Yongfeng kymtwyf

View GitHub Profile
View clickhouse-get-tables-size.sql
select concat(database, '.', table) as table,
formatReadableSize(sum(bytes)) as size,
sum(rows) as rows,
max(modification_time) as latest_modification,
sum(bytes) as bytes_size,
any(engine) as engine,
formatReadableSize(sum(primary_key_bytes_in_memory)) as primary_keys_size
where active
group by database, table
kymtwyf /
Created Oct 9, 2018
Failed to mount Windows share: No route to host, smb, docker

your docker network occupy the address of shared folder

kymtwyf /
Created Jan 12, 2018
script to install robo3t
wget $robo3t_path
sudo mv robo3t-*.tar.gz /opt
cd /opt
sudo tar -xf robo3t-*.tar.gz
sudo rm robo3t-1.1.1-linux-x86_64-c93c6b0/lib/libstdc++*
sudo ln -s /opt/robo3t-*/bin/robo3t /usr/local/bin/robo3t
kymtwyf / What the hack is npm
Created Nov 30, 2017
npm, package.json, package-lock.json, changes, windows
View What the hack is npm


I was trying to install a new package vue-lazy-render (low star number I know...) to our TaaS front end project.

However, after I run npm install vue-lazy-render and waiting for several seconds, the package-lock.json is **CHANGED in many places **

package-lock.json is changed !

I was wondering why this happens? AFAIK, the package-lock.json should lock my npm package version and should not change that frequently when I run npm install

kymtwyf /
Created Aug 19, 2017
docker remove images by image id
docker ps -a | grep "cfb329be3a91" | awk '{ print $1 }' | xargs docker rm`

cfb329be3a91 : the image id

kymtwyf /
Created Aug 3, 2017
weixin-js-sdk, jssdk, wkwebview, wechat, 微信, chooseImage, previewImage, localIds,


看这里 还有这里

大概需要用__wxjs_is_wkwebview判断是不是wkwebview, 如果是的话就用getLocalImgData得到base64的图片内容贴到src里面,如果不是就正常处理用localid即可。

kymtwyf /
Created Aug 2, 2017
weixin-js-sdk, config:fail


  1. 参数错误, 注意大小写,以及字符串类型
  2. 利用pushState实现的跳转并不行
kymtwyf / windows CRLF LF .md
Created Jul 19, 2017
Windows 下使用git的换行符问题, windows, CRLF, LF, git, .gitattributes
View windows CRLF LF .md

关于windows环境下CRLF line deliminator 的说明

  1. git 有一个config 叫core.autocrlf 如果设置为true的话, windows下git会在
  • checkout的时候把LF转换为CRLF (如果这时用eslint的linebreak-style进行较难的话会报错 message: 'Expected linebreaks to be 'LF' but found 'CRLF'. (linebreak-style)' )
  • push 的时候把CRLF转换为LF (这样保证服务器上还是LF)
  • 解决办法如2,3描述
  1. .gitattributes这个文件里面可以控制git在clone代码时对于line deliminator的转换 添加如下规则:
*.js text eol=lf
kymtwyf /
Created Apr 14, 2017
mobile web 去掉回弹效果
$("body").on('touchmove', function(e) { e.preventDefault() });
kymtwyf / update
Created Jan 7, 2017
update nginx to latest version in ubuntu
View update
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx
You can’t perform that action at this time.