<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
data() {
return {
waterMarkConfig: {
width: 340,
height: 240,
content: '这里是水印内容,可以是 git commit id 或 process.env.NODE_ENV',
font: '14px PingFang SC, sans-serif',
...
yum install ImageMagick
反转
convert -flop reverse.jpg reversed.jpg # 水平反转
convert -flip reverse.jpg reversed.jpg # 垂直反转
convert -flip reverse.gif reversed.gif # 垂直反转 GIF 动图
批量缩小 gif (支持缩小动图)
# 仅处理宽度大于 200 的 .gif
find . -type f -name "*.gif" | while read line; echo $line; convert -resize '200>' $line $line; end
批量生成缩略...
启用防火墙
systemctl start firewalld
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --remove-port=3306/tcp --permanent
firewall-cmd --reload
启用交换空间 swap 分区
dd if=/dev/zero of=/swapfile bs=1024k count=8192
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
软件源
...
安装Download URL Rewrite Module 2.1
/web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="http2https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input=&q...
不推荐使用本文的方法,建议使用 props 和 emit
方法来自:stackoverflow.com/questions/55316490,在用这个方法前可以先试试 this.$refs[‘子组件’].doSth(),比下文的方法简单。
子组件
export default {
methods: {
doSth() {
console.log('子组件的 doSth 方法');
},
},
mounted() {
let self = this;
self.$emit('callback', {
doSth: () =&...
# app/Providers/AppServiceProvider.php
public function boot()
{
DB::listen(function ($query) {
$location = collect(debug_backtrace())->filter(function ($trace) {
return !str_contains($trace['file'], 'vendor/');
})->first(); // grab the first element of non vendor/ calls
$bindings = implode(", ", $query->bindings); // format t...
生成版本号配置的文件
hooks.js
const packageInfo = require('./package.json');
const fs = require('fs');
const gitHEAD = fs.readFileSync('.git/HEAD', 'utf-8').trim();
const ref = gitHEAD.split(': ')[1];
let version = packageInfo.version;
let commitId = ref ? fs.readFileSync('.git/' + ref, 'utf-8').trim() : gitHEAD;
let ...
驱动来自 blackPantherOS/rtl8192fu(代码被清了,历史记录里还有,拉下来后 git reset –hard 即可)
下载
安装后需要重启
开机后如果没有出现 WiFi 设备而是多了一个 CD-ROM 的话,执行:
usb_modeswitch -v 0bda -p a192 -KW
# usb_modeswitch 不会开机自动运行可以参考这个:
# mv /lib/udev/rules.d/40-usb_modeswitch.rules /lib/udev/rules.d/61-usb_modeswitch.rules
# sudo udevadm control --reload-rule...
.env
APP_VERSION=v2.0.1 beta
app/Http/Kernel.php
protected $middleware = [
// ...
\App\Http\Middleware\Version::class, // 在 http header 中返回当前接口的 Git 版本
];
app/Http/Middleware/Version.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class Version
{
/**
* 在 header 中添加项目 Git 库的 commit id
*
* @para...
function dodash(callsign = '') {
var sign = callsign.match(/[a-z0-9]+/)[0].toUpperCase();
var hash = 0x73e2;
var i = 0;
while (i < sign.length) {
var f = sign[i].charCodeAt();
hash ^= f<<8;
if (sign[i + 1]) {
var s = sign[i+1].charCodeAt();
hash ^= s;
}
i += 2;
}
return Math.abs(hash);
}
var code = dodash('BZ0ZZZ');
co...
const packageInfo = require('./package.json');
const fs = require('fs');
const gitHEAD = fs.readFileSync('.git/HEAD', 'utf-8').trim();
const ref = gitHEAD.split(': ')[1];
let version = packageInfo.version;
let commitId = '';
if (ref) {
commitId = fs.readFileSync('.git/' + ref, 'utf-8').trim();
} else ...
介绍
laravel-nestedset(Nested Set Model)
安装
composer require kalnoy/nestedset
用法
// database/migrations/2020_08_10_155445_create_category_table.php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCategoryTable extends Migration
{
public function up()
{
Schema::create('categor...