驱动来自 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...
当服务器宕机时,同一个页面的所有接口都会报错,导致页面出现一堆消息,本文方法可以让相同内容的消息只显示最后一个。
不支持 .error() 式的用法。
操作步骤
编辑 main.js,添加以下代码:
import { Message } from 'element-ui';
var MessageStack = [];
Vue.prototype.msg = function(config = {}) {
MessageStack.forEach(function(item = {}) {
if (item.message == config.message && ite...
仅支持无感知验证,
vue-recaptcha-v3
yarn add vue-recaptcha-v3
src/main.js
import { VueReCaptcha } from 'vue-recaptcha-v3';
Vue.use(VueReCaptcha, {
siteKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
loaderOptions: {
// 是否使用国内的 recaptcha.net 域名
useRecaptchaNet: true,
// 是否隐藏“由reCAPTCHA 提供保护 隐私 - 使用条件”
autoHideBadge: process.env.N...
安装 Laravel
composer create-project laravel/laravel ./
修改依赖的下载源
composer global require slince/composer-registry-manager
composer repo:ls
composer repo:use aliyun
添加项目依赖
composer require doctrine/dbal # 增加修改表结构功能
composer require zedisdog/laravel-schema-extend # 增加表注释功能
composer require laravel/passport # OAuth
composer require spatie/laravel-permission # Permis...
问题
$this->validate
是因为所有控制器都使用了 ValidatesRequests Trait,所以可以使用这个 Trait
中提供的 validate() 方法
那 \App\Http\Requests 里的 validate () 方法是从哪里来的?最终实现是相同的吗?为什么会有两种写法?(我知道Validator::make() 是为了在 控制器外边用)
Laravel 代码如下:
$request->validate()
protected function validateLogin(\App\Http\Requests $request)
{
$request->...
Flutter 安装位置
~/Applications/flutter
Fish Shell
# ~/.config/fish/config.fish
set -gx PATH $PATH $HOME/.bin ~/Applications/flutter/bin
set -x PUB_HOSTED_URL https://pub.flutter-io.cn
set -x FLUTTER_STORAGE_BASE_URL https://storage.flutter-io.cn
检测是否符合要求
flutter doctor
yarn config set -g registry https://registry.npm.taobao.org
yarn config set -g disturl https://npm.taobao.org/dist
yarn config set -g electron_mirror https://npm.taobao.org/mirrors/electron/
yarn config set -g sass_binary_site https://npm.taobao.org/mirrors/node-sass/
yarn config set -g phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/
yarn config set -g chromedriver_cdnurl http...
用法
用下文中的代码创建 appkeyable.ahk 并用 AutoHotKey V1 打开,功能与这里类似:
CapsLock + 字母 --> 打开或切换到指定的程序窗口,若已是指定窗口则在窗口间循环切换
与 Alt+Tab 的区别:一次到位,指哪打哪,不需要再按多次来寻找需要的软件。
下载 appkeyable.tgz(内含已转为 appkeyable.exe 的 appkeyable.v3.ahk,可以不安装 AutoHotKey V1 直接运行)
代码
AutoHotKey 目前有 V1 和 V2 两个版本,可以同时...