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
--- TLP 1.5.0 -------------------------------------------- | |
+++ Configured Settings: | |
defaults.conf L0004: TLP_ENABLE="1" | |
defaults.conf L0005: TLP_WARN_LEVEL="3" | |
defaults.conf L0006: TLP_PERSISTENT_DEFAULT="0" | |
defaults.conf L0007: DISK_IDLE_SECS_ON_AC="0" | |
defaults.conf L0008: DISK_IDLE_SECS_ON_BAT="2" | |
defaults.conf L0009: MAX_LOST_WORK_SECS_ON_AC="15" | |
defaults.conf L0010: MAX_LOST_WORK_SECS_ON_BAT="60" |
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
function fillTriangle(N) { | |
const lines = []; | |
function makeRound() { | |
let x = round - 1; | |
let y = round - 1; | |
let step = 1; | |
try { | |
(lines[y] ??= [])[x] = n; | |
canFinishFill(); |
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
/** | |
* dic.txt 内每行类似 'a'ba 阿巴 | |
* 先组合声母韵母,然后再完整替换 | |
* 对于零声母音节,声母当作空字符 | |
**/ | |
const fs = require('fs') | |
// 声母 | |
const shengmu = { |
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
#!/bin/env bash | |
set -euo pipefail | |
function _d() { | |
echo `date +%Y%m%d-`$1 | |
} | |
cd /var/log/nginx | |
h=$((`date +%H`-1)) | |
if [ $h = -1 ]; then | |
h=23 |
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
const cp = require("child_process") | |
const fs = require("fs/promises") | |
const path = require("path") | |
try { | |
cp.execSync("npx tsc --noEmit") | |
} catch (e) { | |
const output = e.stdout.toString() | |
const regexp = /^(.+\.ts)\((\d+?),(\d+?)\): error TS411(4|6):.+/ | |
const overrideFiles = output.split("\n").reduce((m, line) => { | |
const result = line.match(regexp) |
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
javascript:var multiEle=document.getElementsByClassName('MreMs')[0];var i=(multiEle!=null)?multiEle.style.transform.slice(12, -3)/480:0; var img=document.getElementsByClassName('ZyFrc')[0].getElementsByClassName('FFVAD')[i];window.open(img.src) |
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
'use strict' | |
function resolver(o) { | |
return new Promise((res) => { | |
setTimeout(() => { | |
console.log(Date.now(), 'prepare end', o.service) | |
res() | |
}, 1000) | |
}) | |
} |
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
class TaskList { | |
constructor(tasks) { | |
this.tasks = tasks | |
this.promise = null | |
this.index = 0 | |
this.fowarding = false | |
} | |
async start() { | |
this.fowarding = true |
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
let id = 1 | |
function Promise(executor) { | |
this.id = id++ | |
this.status = 'pending' | |
this.value = null | |
this._next = null | |
const response = (status, v) => { | |
if (this.status != 'pending') { | |
return | |
} |
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
const numsNum = 10 | |
const nums = '0'.repeat(numsNum).split('').map(() => parseInt(Math.random() * 100) + 1) | |
console.log('before sort', nums) | |
const arrs = [] | |
let push = 0 | |
// 这里的循环说明了空间使用是 O(n2) | |
for (const num of nums) { |
NewerOlder