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

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

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

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

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

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

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

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

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

程序猿 - 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 284 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 1125 2 1

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

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

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 439 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 962 0 1

新闻热点 - NBA

NBA

铁头娃讯 10月14日消息,根据腾讯体育的NBA直播单,已经恢复部分比赛的视频直播。这两场比赛分别为6点公牛对猛龙以及8点以色列马卡比对阵森林狼。另据观察者网报道,在NBA中国...

Vicw.com用户头像 - 撸猫铁头娃 撸猫铁头娃 1091 1 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 638 0 0

客户端预编译的压缩包可以在如下几个站点找到:Github Release: github.com/v2ray/v2ray-coreGithub 分流: github.com/v2ray/distHomebrew: github.com/v2ray/homebrew-v2rayArch Linux: packages/community/x86_64/v2ray/Snapcr...

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

查看开发的端口firewall-cmd --list-ports开放端口 10235firewall-cmd --zone=public --add-port=10235/tcp --permanent 重启firewall   firewall-cmd --reload

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

回滚特定文件:rake db:migrate:down VERSION=20170726090222要查找所有迁移的版本,可以使用以下命令:rake db:migrate:statusdatabase: iotboss_08_09_b1 Status   Migration ID    Migration Name-----------------------...

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

新闻热点 - 致敬阿联 !!!

从2004年雅典奥运会到2019年中国男篮世界杯、从“阿联”到“联哥”、从16岁到31岁……中国男篮不敌尼日利亚男篮的比赛,易建联完成了一场堪称伟大的个人秀,对于跟随中国男篮见...

Vicw.com用户头像 - 撸猫铁头娃 撸猫铁头娃 1530 1 2

新闻热点 - RNG VS FPX 大战一触即发!!!

经历了一个夏天今天我们一起来揭晓答案是凤鸣九洲,一飞冲天还是御剑夺魁,沐浴金雨下午16:00终局一战2019英雄联盟职业联赛夏季总决赛

Vicw.com用户头像 - 撸猫铁头娃 撸猫铁头娃 1663 1 1

清除坏的<none>:<none>镜像docker rmi $(docker images -f "dangling=true" -q)

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

周琦尽力了,输球不怪他。发球出失误,只因压迫大。八成命中率,得分一十加。火锅篮板送,你还想要啥?队友全是坑,早被打成瓜。赵睿投不准,艾伦快打卡。小川总受伤,联妹...

Vicw.com用户头像 - 撸猫铁头娃 撸猫铁头娃 1721 1 1

宿主机已经运行mysql在3306端口,这个时候 映射容器中的 mysql '3306:3306' 就会和外部冲突,这个时候 映射 3308 到容器mysql的3306CONTAINER ID        IMAGE                    COMMAND    ...

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

新闻热点 - 恭喜fpx成为lpl第一支进入全球总决赛的队伍!fpx将第一次代表lpl出征世界赛!

Doinb等这一刻5年了。5年前初登赛场,一手维克托名扬天下,可英雄池的属性让他饱受争议,到现在还有人提起。4年前Doinb所在的QG2比3不敌LGD,没人想到这居然是Doinb离全球总决赛最...

Vicw.com用户头像 - 撸猫铁头娃 撸猫铁头娃 2087 2 1

新闻热点 - 连续四年出征,RNG成为LPL第二支拿到S9门票的队伍

在刚刚结束的LPL夏季赛半决赛当中,RNG以3-1的比分击败TES成功挺进决赛。凭借春季赛拿到的10积分以及进入夏季赛决赛至少能够获得的90积分,RNG以保底100分的积分优势,成为继FPX之...

Vicw.com用户头像 - 撸猫铁头娃 撸猫铁头娃 1501 0 1

程序猿 - 使用阿里云加速器提升获取Docker官方镜像的速度

https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors

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

程序猿 - SIMSKY Vue 前后端分离

一、技术栈基于 es6、vue、vuex、vue-router 、vue-cli 、axios 和 element-ui,(请求数据使用Mock.js进行模拟)Vue 生态圈Vue Router 是 vue 官方的路由。它能快速的帮助你构建一个单页面或者多页面...

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

 SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='数据库名' AND pid<>pg_backend_pid(); 

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

Golang Tutorial - Securing Your Go REST APIs With JWTs

Note - The full source code for this tutorial can be found here: TutorialEdge/go-jwt-tutorialJWTs, or JSON Web Tokens as they are more formally known, are a compact, URL-safe means of representing claims to be transferred between two part...

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

JavaScript Frontend frameworks have undoubtedly helped to push the boundaries of what was previously possible in the context of a browser. Ever more complex applications have come out built on top of the likes of React, Angular and VueJS to...

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

Golang Tutorial - Building a Solid Continuous Integration Pipeline with TravisCI for Your Go Projects

So, I recently partook in Hacktoberfest which is an event that helps to support thousands of different Open Source projects. Usually, I tend to get caught up in other projects or can't find the time or make up a hundred other excuses for ...

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

ObjectivesBy the end of this tutorial, you will be able to...Encrypt text using the AES - Advanced Encryption Standard in GoWe'll then look at writing this encrypted message to a fileFinally we'll look at how we can decrypt this message usi...

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

Golang Tutorial - Go Face Recognition Tutorial - Part 1

The whole area of Face Recognition is something I love reading about. Implementing a facial recognition system yourself makes you sound like you are Tony Stark and you can use them for a variety of different projects such as an automatic lo...

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

Welcome fellow coders! In this tutorial, we are going to be taking a look at how you can implement your own OAuth2 Server and client using the go-oauth2/oauth2 package.This is without a doubt one of the most requested topics from commento...

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