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/19 [ 19] => 0.0006 = (0.0526 - 0.0521) | |
4/14 [104] => 0.0008 = (0.2857 - 0.2849) | |
8/13 [225] => 0.0011 = (0.6154 - 0.6164) | |
3/15 [ 74] => 0.0027 = (0.2000 - 0.2027) | |
2/16 [ 47] => 0.0038 = (0.1250 - 0.1288) | |
1/20 [ 20] => 0.0048 = (0.0500 - 0.0548) | |
1/18 [ 18] => 0.0062 = (0.0556 - 0.0493) | |
7/13 [194] => 0.0070 = (0.5385 - 0.5315) | |
2/15 [ 46] => 0.0073 = (0.1333 - 0.1260) | |
9/13 [256] => 0.0091 = (0.6923 - 0.7014) |
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
name: Node CI | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**/readme.md' | |
jobs: |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"allowJs": true, | |
"skipLibCheck": true, | |
"esModuleInterop": true, | |
"allowSyntheticDefaultImports": true, | |
"strict": true, | |
"forceConsistentCasingInFileNames": true, | |
"moduleResolution": "node", | |
"resolveJsonModule": 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
[ | |
{ | |
"id": "877f0c504eb0eb9e", | |
"type": "websocket out", | |
"z": "bf3d520d6566704c", | |
"name": "", | |
"server": "b94d746ecdec7aad", | |
"client": "", | |
"x": 910, | |
"y": 220, |
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 a = [ | |
{ name: 'a', age: 10 }, | |
{ name: 'b', age: 20 }, | |
] | |
a.map((p) => { | |
const len = p.name.length | |
const id = `${p.name}-${p.age}` | |
const ageDouble = p.age * 2 |
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
[ { "id": "f6f2187d.f17ca8", "type": "tab", "label": "Swarippa", "disabled": false, "info": "", "env": [] }, { "id": "19e47bd1eea2e757", "type": "http request", "z": "f6f2187d.f17ca8", "name": "Slack Webhook - elzup", "method": "POST", "ret": "txt", "paytoqs": "ignore", "url": "${SLACK_URL}", "tls": "", "persist": false, "proxy": "", "authType": "", "senderr": false, "x": 1050, "y": 1180, "wires": [ [] ] }, { "id": "803d03164af5eb1a", "type": "change", "z": "f6f2187d.f17ca8", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "{\"text\":\"動いて!\",\"icon_emoji\":\":chair:\",\"username\":\"座りっぱ執事\"}", "tot": "json" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 820, "y": 1180, "wires": [ [ "19e47bd1eea2e757", "29d5897e04face4f" ] ] }, { "id": "29d5897e04face4f", "type": "debug", "z": "f6f2187d.f17ca8", "name": "debug log", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusTy |
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
import { promisify } from 'util' | |
const sleep = (ms: number) => new Promise(r => setTimeout(r, ms)) | |
const argSwap = <A1, A2, R>(f: (a1: A1, a2: A2) => R) => (a2: A2, a1: A1) => | |
f(a1, a2) | |
const sleep2 = promisify((ms, cb) => setTimeout(cb, ms)) | |
const sleep3 = promisify(argSwap(setTimeout)) |
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 { readdir } = require('fs').promises | |
const readdirRecursiveEnt = async (dir, ent) => { | |
const path = `${dir}/${ent.name}` | |
if (ent.isFile()) return path | |
if (ent.isDirectory()) { | |
return await readdirRecursive(path) | |
} | |
console.log(`${ent.name} is not a file or directory`) | |
return null |
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
# install n | |
sudo apt install -y nodejs npm | |
sudo npm install n -g | |
# install node by n | |
sudo n stable | |
sudo apt purge -y nodejs npm | |
# reload | |
exec $SHELL -l |
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
import fs from 'fs' | |
import { promisify } from 'util' | |
import network from 'network' | |
const getActiveInterface = promisify(network.get_active_interface) | |
const getCurrent = async () => (await getActiveInterface())?.mac_address | |
const SAVE_FILE = 'home.mac.txt' | |
const saveHomeNetwork = (id: string) => fs.writeFileSync('home.mac.txt', id) |
NewerOlder