kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

javascript随机打乱数组

https://www.coder.work/article/3779797

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const shuffle = ([...array]) => {
	let i = 0;
	let j = 0;
	let temp = null;

	for (i = array.length - 1; i > 0; i -= 1) {
		j = Math.floor(Math.random() * (i + 1));
		temp = array[i];
		array[i] = array[j];
		array[j] = temp;
	}
	return array;
}

id2nos = shuffle(id2nos);

language, web

« php的GD库,相同的字符串生成相同的二维码 Vim 在处理长字符串时变得非常慢 »