sudo apt update
sudo apt install software-properties-common -y
» sudo systemctl daemon-reload
System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down
==============================================
Edit*
/etc/wsl.conf
with any editor:{ | |
schemes: [ | |
{ | |
"name": "One Dark Pro", | |
"foreground": "#abb2bf", | |
"background": "#282c34", | |
"cursorColor": "#abb2bf", | |
"black": "#3f4451", | |
"red": "#e05561", | |
"green": "#8cc265", |
編輯 %UserProfile%\.wslconfig
檔案
Command Prompt
notepad %UserProfile%\.wslconfig
Windows PowerShell
/** | |
* https://github.com/GoogleChromeLabs/comlink/blob/master/docs/examples/06-node-example/main.mjs | |
* https://github.com/GoogleChromeLabs/comlink/issues/476#issuecomment-642765445 | |
* esModuleInterop to true in tsconfig.json compilerOptions. | |
*/ | |
import { Worker } from 'worker_threads'; | |
import * as comlink from 'comlink'; | |
import nodeEndpoint from 'comlink/dist/umd/node-adapter'; | |
import { cpus } from 'os'; |
import { getRemoteAPI } from "./my_worker"; | |
async function init() { | |
console.time("launch"); | |
const api = getRemoteAPI(); | |
console.timeLog("launch"); | |
console.time("first result"); | |
console.timeLog("first result", await api.doMath()); | |
console.time("second result"); | |
console.timeLog("second result", await api.doMath()); |
var div = document.querySelectorAll('div'), | |
result; | |
for (var i = 0; i < div.length; i++) { | |
result = div[i]; | |
result.addEventListener('click', function() { | |
alert(this.innerHTML); | |
}); | |
} |
// map.ts | |
import {Observable} from "./observable"; | |
declare module "./observable" { | |
interface Observable<T> { | |
map<U>(f: (x: T) => U): Observable<U>; | |
} | |
} | |
Observable.prototype.map = function (f) { | |
// ... another exercise for the reader |