Skip to content

Instantly share code, notes, and snippets.

Avatar

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
from system.parts
where active
group by database, table
@kymtwyf
kymtwyf / maybe.md
Created Oct 9, 2018
Failed to mount Windows share: No route to host, smb, docker
View maybe.md

your docker network occupy the address of shared folder

@kymtwyf
kymtwyf / install_robo3t.sh
Created Jan 12, 2018
script to install robo3t
View install_robo3t.sh
#!/bin/bash
robo3t_path=https://download.robomongo.org/1.1.1/linux/robo3t-1.1.1-linux-x86_64-c93c6b0.tar.gz
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
kymtwyf / What the hack is npm installing.md
Created Nov 30, 2017
npm, package.json, package-lock.json, changes, windows
View What the hack is npm installing.md

Background

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
kymtwyf / rmbyimg.md
Created Aug 19, 2017
docker remove images by image id
View rmbyimg.md
docker ps -a | grep "cfb329be3a91" | awk '{ print $1 }' | xargs docker rm`

cfb329be3a91 : the image id

@kymtwyf
kymtwyf / mabi.md
Created Aug 3, 2017
weixin-js-sdk, jssdk, wkwebview, wechat, 微信, chooseImage, previewImage, localIds,
View mabi.md

微信企业号里面img直接填src无效问题

看这里 还有这里

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

@kymtwyf
kymtwyf / mabi.md
Created Aug 2, 2017
weixin-js-sdk, config:fail
View mabi.md

可能的原因

  1. 参数错误, 注意大小写,以及字符串类型
  2. 利用pushState实现的跳转并不行
@kymtwyf
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
kymtwyf / remove-touchmove.md
Created Apr 14, 2017
mobile web 去掉回弹效果
View remove-touchmove.md
$("body").on('touchmove', function(e) { e.preventDefault() });
@kymtwyf
kymtwyf / update nginx.md
Created Jan 7, 2017
update nginx to latest version in ubuntu
View update nginx.md
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.