1. 选择权回到用户手中。需要用户主动点击授权之后,小程序才能向其推送服务通知,
2、时长不受限制。「订阅消息」取消了7天内推送消息的时间限制,只要用户没有主动拒收消息推送,开发者就可以随时推送服务通知。
...
2019/12/27
2019/12/25
docker image build Dockerfile
docker-compse.yml 内で定義 go のimage
image:xxx/xxx ->直接pull して使う
imageを調査する
履歴調査 docker image history image_name
構成調査 docker image inspect image_name
build a image from dockerfile
docker build --help
Dockerfile 原則
1. container from Dockerfile is ephemeral
2. one container one process (easy to scale horizontally)
3. minimize container layer ( use one-line command. one command one layer)
RUN apt-get update && apt-get install -y \
bzr \
cvs \
git \
mercurial \
subversion
4. docker build...
2019/12/24
ninson ignore
-ignore='Path .git'
-ignore='Path .github'
-ignore='Path docker-compose'
-ignore='Path .idea'
-ignore='Name *.gitignor...
docker mac performance
docker use linux kernel almost as native, so performance is well.
in mac or windows, things are different. there is no linux kernel.
so some helper needed.
docker-machine: a tool to install docker in virtual machine. Dockerized hosts (hosts with Docker Engine on them).
docker for Mac/Windows: even still run a virtual machine (super hidden ).with its own hypervisor “hyperkit” and shared file system “osxfs”. Unfortunately, “osxfs” wasn’t very fast.
but in many cases, realtime host-virtual consistence is not necessary.
So...
docker run exec
「docker run」コマンドは、コンテナを作成して起動するコマンド。
docker run -it image_name "/bin/bash"
他のTabでdocker ps
Containerが増える。
実質は:
docker create image_name
docker start image_name
「docker exec」コマンドは、起動中のコンテナ内で、指定したコマンドを実行するコマンド。
docker ps
docker exec -it container_id "/bin/bash"
docker-run options image_name init_command
-- name (起動されたContainerに名前)
-- rm (Container終了時削除)
-v fromHostSrc:toContainerTarget-e env parameters
-d run in backend
docker-sync start サンプル:
docker run --rm -v "dir1:/app_sync"...
2019/12/20
wechat pay

...
wechat miniapp login

wechat miniApp: wx.login -> code
wechat miniApp: wx.request , send code to server api
server request
wechat API,get openId and sesion_key: https://api.weixin.qq.com/sns/jscode2session?appid=a&secret=b&js_code=codegrant_type=authorization_code
use openId and session_key to generate access token
response access token and openId to miniAPP(token1)
wechat miniApp: wx.getSetting check user's authority.if not ,request user's...
docker show all container ,delete all
docker show all container : docker container ls -a
docker show volume: docker volume ls
docker show image: docker image ls
delete all unused objects: docker system prune -f --volumes
delete all images: docker image prune -a
docker-compose up -d --remove-orphans
スキリした。普通に30Gぐらい削除した。unusedの基準は曖昧か...
2019/12/18
golang gorm update when record not exist
when record is not exist. update will be success.
have to check RowsAffected .
the same as delte
query := db.Model(r).Updates(something)
if query.Error != nil {
return query.Error
}
if query.RowsAffected == 0 {
return gorm.ErrRecordNotFound
}
query := db.Delete(&something{ID: ID})
if query.Error != nil {
return query.Error
}
if query.RowsAffected == 0 {
return gorm.ErrRecordNotFound
...
2019/12/16
MacOS bad support on HFS/APFS
MacOS/OSX has very bad filesystem events support on HFS/APFS, watching the file-system for changes using unox or fswatch was causing a heavy CPU load. This CPU load is very significant, even on modern high-end CPUs (like a i7 4770k / 3.5GHz)...