Rails find_or_create_by : 查找具有给定属性的第一条记录,或创建一条记录 def find_or_create_by(attributes, &block) find_by(attributes) || create(attributes, &block) end 但请注意,此方法不是原子方...

Vicw.com用户头像 - XanderCheung XanderCheung 683 0 1

比如 sh install.sh 执行过程中需要键盘输入 :Enter,yes,Enter,yesRUN sh -c '/bin/echo -e "\nyes\n\nyes" | sh install.sh'

Vicw.com用户头像 - XanderCheung XanderCheung 575 1 0

用docker 构建elasticsearch时, 加入 elasticsearch-analysis-ik 分词,但是构建不成功,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@     WARNING: plugin requires additional permissions     @@@@@@@@@@@@@@...

Vicw.com用户头像 - XanderCheung XanderCheung 568 0 0

程序猿 - Web Api  MediaDevices .getUserMedia()   navigator.mediaDevices is undefined

chrome中非https无法打开摄像头 MediaDevices .getUserMedia()方法提示用户使用媒体输入的权限,该输入会产生MediaStream并包含包含请求的媒体类型的轨道. 该流可以包括,例如,视频轨道(由...

Vicw.com用户头像 - XanderCheung XanderCheung 1064 0 2

程序猿 - IdeaVim 快捷键

原文:Learn Vim Progressively1st Level – Survivei → Insert mode. Type ESC to return to Normal mode.x → Delete the char under the cursor:wq → Save and Quit (:w save, :q quit)dd → Delete (and copy) the current linep ...

Vicw.com用户头像 - XanderCheung XanderCheung 796 0 1

Manjaro 启动vmware中虚拟机失败:Unable to install module vmware-workstation/15.1.0_13591040 for kernel 5.3.15-1-MANJARO: Missing kernel headers.Missing kernel headers1.根据系统的内核安装 linux-headersuname -r => 5.3.15-1-...

Vicw.com用户头像 - XanderCheung XanderCheung 2214 2 1

本文概要: git 工作流 git 常用操作命令 git merge VS git rebase 回退版本 git reset VS git revert 1.工作流: 核心: (1)任何新的功能(feature)或 bug 修复全都新建一个 branch 来写 (2)branc...

Vicw.com用户头像 - XanderCheung XanderCheung 1286 0 1

TL;DR: run gem update --system.What is this bug?Some versions of RubyGems try to use the exact version of Bundler listed in your Gemfile.lock anytime you run the bundle command. If you are using one of those versions of RubyGems, but do no...

Vicw.com用户头像 - XanderCheung XanderCheung 755 0 0

WARNING: Error loading config file: /home/$USER/.docker/config.json: open /home/$USER/.docker/config.json: permission deniedTry this:sudo chown $USER:docker ~/.docker sudo chown $USER:docker ~/.docker/config.json sudo chmod g+rw ~/.docker/c...

Vicw.com用户头像 - XanderCheung XanderCheung 1314 0 1

To clear containers:docker rm -f $(docker ps -a -q)To clear images:docker rmi -f $(docker images -a -q)To clear volumes:docker volume rm $(docker volume ls -q)To clear networks:docker network rm $(docker network ls | tail -n+2 | awk '{if($2...

Vicw.com用户头像 - XanderCheung XanderCheung 953 0 0