golang-给-struct-赋值-nil
struct ListNode { Val int Next *ListNode } var li *ListNode = nil 原文见csdngo-环境变量设置-proxy
Go version >= 1.13 当你的GO的版本大于1.13的时候 当你安装的GO的语言版本大于1.13的时候,那么就不用这么麻烦了,直接使用go env -w命令就行了 go env -w GOPROXY=https://goproxy.io,direct go env -w GOPRIVATE=*.corp.example.com go env -w GO111MODULE=on 转自掘金c语言中的-sleep()-函数在-windows-和-linux-下的不同表示
在 windows 中, Sleep() // test.c #include <stdio.h> #include <windows.h> int main(){ Sleep(3000); printf('hello C'); return 0; } 在 linux 中, sleep() // test.c #include <stdio.h> #include <stdlib.h> int main(){ sleep(3000); printf('hello C'); return 0; }查看路由(接口数)
// web php artisan route:list | wc -l | awk '{print $1 - 4}' // api $ php artisan api:route | wc -l | awk '{print $1 - 4}' 原文见 learnkularavel-队列
windows 中使用 horizon, 原文见 github, learnku composer require laravel/horizon --ignore-platform-reqs php artisan vendor:publish --provider="Laravel\Horizon\HorizonServiceProvider" 在 .env 中将 QUEUE_CONNECTION 改为 reids 后需要在命令行运行 php artisan queue:listen 或 php artisan queue:work 才会开启队列中的任务 因为错误原因一直重复执行某一个队列, 重启 redis 依然如此, 那么需要清空 redis 中的数据 redis-cli #进入脚手架 flushall #清空redis的数据 learnku overtrue 给队列新建 redis 连接array_filter-过滤数组中值为空的元素
array_filter ( array $array [, callable $callback [, int $flag = 0 ]] ) : array 通过回调函数返回 true 返回过滤数组中的单元, 组成新数组并最终返回 如果, callable 为空, 则默认过滤数组中等值为 false 的单元(如 null, ‘’, ’ ‘, 0) 等laravel-关联模型使用-with-调数据时指定字段出错
laravel 关联模型使用 with 调数据时指定字段必须包括 外键的字段 参考: laravel5.1 eloquent with 通过闭包筛选特定 field 得不到结果的问题laradock-数据库连接
adminer 容器 up 后, 在 127.0.0.1:8080 使用 [ ‘服务器’ => ‘mysql’ ], root + root 默认账户可以登录; 在 navicat 中, 则使用 127.0.0.1 + root + root 即可登录 新的 mysql 数据库可以新建一个测试用户 CREATE USER 'test'@'%' IDENTIFIED BY 'test'; GRANT ALL ON *.* TO 'test'@'%'vue-@input-事件
input 事件 结合了 keyup事件 和 change事件, 会在 keyup 时判断值是否发生变化, 变化了则触发该事件 // html <input v-model="keyword" type="text" id="search" @input="onSearch" autofocus class="input_search" placeholder="问题或选项关键词"> // js onSearch() { ... keyup事件 也可以使用一个旧值在 keyup 的时候来比较值是否变化, 如果没有变化就直接return, 否则给旧值赋上新值, 再进行接下去的业务逻辑 // html <input v-model="keyword" type="text" id="search" @keyup="onSearch" autofocus class="input_search" placeholder="问题或选项关键词"> // js onSearch() { if(this.keyword === this.keyword_old){ return } this.keyword_old = this.keyword ...laravel-policy-返回值类型只能是-boolean(true-或-false)
不能为 int string array 等
Recent Posts
Tags
- apache 4
- axios 1
- benchmark 1
- c 1
- canvas 1
- centos 3
- channel 1
- crontab 1
- css 2
- docker 4
- fail2ban 1
- frp 1
- gin 1
- github 1
- go 26
- goaccess 1
- goroutine 1
- http 1
- https 1
- jetbrains 1
- jquery 1
- js 2
- linux 20
- mermaid 1
- mysql 10
- nginx 3
- node 1
- php 43
- prisma 1
- react 8
- server 1
- ssh 2
- tarojs 1
- tcp/ip 1
- token 1
- ubuntu 1
- ufw 1
- unit-test 1
- vmware 1
- vscode 1
- vue 12
- yum 1
- 域名 3
- 安全 2
- 微信 3
- 算法 3