This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Timer类用于创建一个倒计时器 | |
* 用本地时间差来解决由于js阻塞导致的倒计时延迟的问题 | |
*/ | |
class Timer { | |
/** | |
* 创建一个新的Timer实例 | |
* @param {Object} dates - 包含开始和结束时间的对象,时间可以是日期字符串或者以秒为单位的时间戳 | |
*/ | |
constructor(dates) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
globalThis.TrackHck = function (t) { | |
var o = this.eN()[t]; | |
var trk = o && (o.track && o.track.track ? o.track.track : o.track || o); | |
if (!trk) { | |
return o; | |
} | |
var f = trk.privilege; | |
if (!f) { | |
return o; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ST股5%,沪深10%,科创版/创业板20%,北交所30% | |
const MARKET = { | |
"st": {lable: "ST股票", value: 0.05}, | |
"sh": {lable: "沪深板块", value: 0.1}, | |
"kc": {lable: "科创版/创业版", value: 0.2}, | |
"bj": {lable: "北交所", value: 0.3}, | |
}; | |
/** | |
* 计算A股涨停和跌停的价格 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
export PATH | |
# -------------------------------------------------------------- | |
# 系统: CentOS/Debian/Ubuntu | |
# 项目: 解锁网易云音乐 | |
# 版本: 1.1.1 | |
# 作者: XIU2 | |
# 官网: https://shell.xiu2.xyz | |
# 项目: https://github.com/XIU2/Shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu20.04 用着用着突然发现设置不见了,即使重启电脑还是找不到设置,后来通过扒帖子发现是一个包丢失了,gnome-control-center,重新安装一个这个包就好了 | |
```bash | |
sudo apt install gnome-control-center | |
``` | |
附上前面扒到的帖子: | |
>https://forum.ubuntu.com.cn/viewtopic.php?t=491114 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Ubuntu20.04 安装 Mysql | |
* [1、方法一: 下载安装 MySQL(安装其他版本)](#1_MySQL_1) | |
* [1.1 在官网下载 mysql 安装包](#11mysql_4) | |
* [1.2 解压文件](#12_7) | |
* [1.3 安装](#13_15) | |
* [2、方法二:通过 apt 安装 MySQL 服务(推荐,会安装最新版)](#2apt_MySQL_65) | |
* [2.1 初始化配置](#21__73) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ubuntu 20 初始化配置 | |
## 一、初始化配置 | |
### 1.更新系统 | |
```bash | |
# 更新本地报数据库 | |
sudo apt update | |
# 更新所有已安装的包(也可以使用 full-upgrade) | |
sudo apt upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```js | |
const log4js = require("log4js"); | |
// log4js的输出级别6个: trace, debug, info, warn, error, fatal | |
const config = { | |
"appenders": { | |
//设置控制台输出 (默认日志级别是关闭的(即不会输出日志)) | |
"consoleout": { "type": "console" }, | |
"access": { | |
"type": "dateFile", //输出到格式化的文件(log/access/access-yyyy-MM-dd.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1.安装nodejs | |
要获得Distro-stable版本的Node.js,您可以使用apt包管理器。首先,刷新本地包索引: | |
```bash | |
sudo apt update | |
``` | |
然后从存储库安装Node.js包: | |
```bash | |
sudo apt install nodejs | |
``` | |
如果存储库中的软件包满足您的需求,那么您需要做的就是使用Node.js进行设置。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 函数防抖(debounce) | |
>解释:当持续触发某事件时,一定时间间隔内没有再触发事件时,事件处理函数才会执行一次,如果设定的时间间隔到来之前,又一次触发了事件,就重新开始延时。 | |
案例:持续触发scroll事件时,并不立即执行handle函数,当1000毫秒内没有触发scroll事件时,才会延时触发一次handle函数。 | |
```JavaScript/** | |
* @param {Function} fn 需要执行的函数 | |
* @param {Number} wait 需要触发的时间 | |
*/ | |
function debounce(fn, wait) { |
NewerOlder