Centos 9 中安装 php 7.4
dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf module list php
dnf install php74-php php74-php-fpm php74-php-mysqlnd php74-php-mcrypt php74-php-gd php74-php-bcmath php74-php-json php74-php-mbstring php74-php-xml php74-php-zip
systemctl enable php74-php-fpm
# /etc/opt/remi/php74/php.ini
# /etc/opt/remi/php74/php-fpm.conf
# 检查依赖是否完整...
绿灯风停,红灯刮风,红绿间隙黄灯。
int Red = 13; // 红灯
int Yellow = 12; // 黄灯
int Green = 11; // 绿灯
int FanA = 8; // 风扇 VINA
int FanB = 9; // 风扇 VINB
void setup() {
pinMode(FanA, OUTPUT);
pinMode(FanB, OUTPUT);
pinMode(Red, OUTPUT);
pinMode(Yellow, OUTPUT);
pinMode(Green, OUTPUT);
}
void loop() {
// 绿灯亮
digitalWrite(Green, HIGH);
...
void setup() {
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
digitalWrite(8, LOW );
digitalWrite(9, HIGH);
}
void loop() {
}
对齐:用 style=”text-align:center” 属性代替 quill 的 class=”ql-align-center” 版对齐功能
import Quill from 'quill';
const QuillAlign = Quill.import('attributors/style/align');
QuillAlign.whitelist = ['right', 'center', 'justify'];
Quill.register(QuillAlign, true);
字号:用 style=”font-size:18px;” 代替 qu...
目标
将对象的所有 key 配置给 watch
代码
const ImageableFields = [
'cover',
'detail',
'reply',
];
// 转换为 FormItem.prop: cover -> form._images_cover
const WatchableFields = ImageableFields.ma(v => `form._images_${v}`);
export default {
props: {
detail: {
type: Object,
default: () => ({}),
},
},
data() {
...
问题描述
数据库字段类型为 datetime,faker 格式为 Y-m-d H:i:s,factory::make() 出来的也是 Y-m-d H:i:s,但是 toArray() 之后变成了 c,c 类似 2024-01-02T03:04:05.000000Z。insert(c) 时候报了标题的信息。
解决方法
方法1:
# /config/database.php
'mysql' => [
'strict' => false, // true 改为 false
],
方法2:
# /app/Models/User.php
protected $casts = [
'created_...
适用版本: frp_0.52.3
服务端
frps.toml
bindPort = 7000
auth.token = "TOKEN"
log.to = "/var/log/frp/log"
allowPorts = [
{ single = 3389 },
{ start = 9000, end = 9999 }
]
webServer.addr = "0.0.0.0"
webServer.port = 7500
webServer.user = "man"
webServer.password = "srcret"
添加为服务 /etc/systemd/system/frpd.service
[Unit]
Desc...
自定义组件内部在 blur 和 change 后增加:
import emitter from 'element-ui/src/mixins/emitter';
let {
methods: { dispatch },
} = emitter;
methods: {
onChange () {
dispatch.call(this, 'ElFormItem', 'el.form.change', this.value);
},
onBlur () {
dispatch.call(this, 'ElFormItem', 'el.form.blur', this.value);
}
}
也可...
用到的软件
ddcctl、Karabiner-Elements.app
用法
RightCmd + \ --> 将副屏输入源切换为 VGA
RightOpt + \ --> 将副屏输入源切换为 HDMI
RightCmd + RightOpt + \ --> 将副屏输入源切换为 DP
changeExternalDisplayInputSource.json
~/.config/karabiner/assets/complex_modifications/
{
"title": "Change the external display input source",
"author": "win...
可以不使用 vite-plugin-mock 只引入 mockjs,但是只使用 mockjs 的话配置会繁琐;vite-plugin-mock 做了将 mockjs 集成到 vite 的工作。
package.json
yarn add -D mockjs vite-plugin-mock
.env
VITE_MOCK_ENABLED=true
vite.config.js
import { loadEnv, defineConfig } from 'vite';
import { viteMockServe } from 'vite-plugin-mock';
export default ({ mode }) => {
const ENV ...
用法
let status = true;
v-loading="status"
JS
const toggleLoading = (el, binding) => {
if (binding.value) {
let dom = `
<div class="el-loading-mask">
<div class="el-loading-spinner">
<svg viewBox="25 25 50 50" class="circular">
<circle cx="50" cy="50&qu...
官方文档在这里:https://vitejs.dev/config/
让 Vue 认出 html 原生的 marquee 标签
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
export default () => {
return defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => ['marquee'].includes(tag), // vue...