Skip to content

Instantly share code, notes, and snippets.

View kymtwyf's full-sized avatar
:octocat:

Wu Yongfeng kymtwyf

:octocat:
View GitHub Profile

create table

CREATE TABLE demo.replacemt (
  key UInt32, 
  value UInt32
)
ENGINE = ReplacingMergeTree
ORDER BY key
@kymtwyf
kymtwyf / SummingMergeTree example.md
Created January 7, 2021 05:33
SummingMergeTree

create database and table

CREATE DATABASE demo

CREATE TABLE demo.summt
(
    key UInt32,
    value UInt32
)
ENGINE = SummingMergeTree()
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 October 9, 2018 03:40
Failed to mount Windows share: No route to host, smb, docker

your docker network occupy the address of shared folder

@kymtwyf
kymtwyf / install_robo3t.sh
Created January 12, 2018 07:35
script to install robo3t
#!/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 November 30, 2017 03:21
npm, package.json, package-lock.json, changes, windows

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 August 19, 2017 07:18
docker remove images by image id
docker ps -a | grep "cfb329be3a91" | awk '{ print $1 }' | xargs docker rm`

cfb329be3a91 : the image id

@kymtwyf
kymtwyf / mabi.md
Created August 3, 2017 14:55
weixin-js-sdk, jssdk, wkwebview, wechat, 微信, chooseImage, previewImage, localIds,

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

看这里 还有这里

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

@kymtwyf
kymtwyf / mabi.md
Created August 2, 2017 17:28
weixin-js-sdk, config:fail

可能的原因

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

关于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