WishMeLz

生活其实很有趣

远程备份MySql数据库 shell

#!/bin/bash # 设置变量 BACKUP_DIR="/app/backsql" # 本地备份目录 MYSQL_USER="" # MySQL 用户名 MYSQL_PASSWORD="" # MySQL 密码 MYSQL_HOST="mysql..com" # MySQL 服务器地址 MYSQL_PORT="3306" # MySQL 端口号 DATABASE_NAME="" # 要备份的数据库名称 BAC...

每日必应壁纸 Bing API

https://global.bing.com/HPImageArchive.aspx?format=js&idx=0&n=8&pid=hp&FORM=BEHPTB&uhd=1&uhdwidth=3840&uhdheight=2160&setmkt=zh_cn&setlang=enhttps://www.bing.com/${url}参数名参数值描述formatjs/rss/xml (必填)决定返回结果格式idx-1 到 8 的整数(必填)日期偏移量,若空或0则返回本日数据,-...

vue中v-html

<p domPropsInnerHTML={item.content}></p> <p v-html={item.content}></p>

随机渐变背景

<style> html, body { margin: 0; } body:after { content: 'click to update'; font-size: 0.8em; color: rgba(0, 0, 0, 0.3); position: fixed; width: 100%; bott...

ANSI 字体在前端展示 Jenkins日志

最近在做运维平台的开发,前端需要显示Jenkins的日志在前端,其中的ANSI字体就是如下示例。192.168.134.39:服务启动,端口检测,等待第3秒 192.168.134.39:服务启动,端口检测,等待第6秒 192.168.134.39:服务启动,端口检测,等待第9秒 192.168.134.39:服务启动,端口检测,等待第12秒 192.168.134.39:服务启动,端口检测,等待第15秒 192.168.134.39:服务启动,端口...

npm 设置与代理

查询当前镜像源npm get registry设置镜像源npm config set registry https://registry.npmmirror.com/electron镜像npm config set ELECTRON_MIRROR "https://npmmirror.org/mirrors/electron/"看和删除electron镜像npm config get ELECTRON_MIRROR npm config delete ELECTRON_MIRROR 查看当前代理npm config get pr...

获取视频某一秒的截图

const handleGetVideoThumb = async function (url, options = {}) { if (typeof url !== "string") { console.error("URL must be a string"); return; } // 默认参数 const ...

SSE(Server-Sent Events)

服务端const express = require("express"); const cors = require("cors"); const app = express(); const port = 6548; app.use(cors()); app.get("/sse", (req, res) => { res.set({ "Content-Type": "text/event-stream", &quo...

公式编辑器

自定义公式编辑器在线预览地址<template> <div class="home"> <div class="calc-main"> <div class="formulaView" id="formulaView" ref="formulaView" @click.stop="recordPosition()...

TOTP otpauth

import * as OTPAuth from "otpauth"; let totp = new OTPAuth.TOTP({ // Provider or service the account is associated with. issuer: "ACME", // Account identifier. label: "AzureDiamond", // Algorithm used for the HMAC fu...

vuedraggable

在线预览<template> <div class="c"> <vuedraggable handle=".handle" class="list-group" tag="ul" v-model="list" v-bind="dragOptions" @start="drag = true" ...

createDecorator 自定义装饰器

二次确认import { MessageBox } from 'element-ui' import { createDecorator } from 'vue-class-component' export function Confirm(msg: any) { return createDecorator(function (opts, handler) { if (!opts.methods) throw new Error( 'This decorator ...