static split_semver(s:string) {
// @arg String - "version-99.88.77"
// @ret NumberArray - [ 99. 88, 77 ]
try {
const [, major, minor, patch] = Array.from(s.match(/(\d{1,2})\.(\d{1,2})\.(\d{1,2})/)); // [, "99", "88", 77" ]
return [
parseInt(major, 10),
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
#user nobody; | |
#user nginx; | |
worker_processes 2; | |
# error_log logs/error.log; | |
# error_log logs/error.log notice; | |
# error_log logs/error.log info; | |
#pid logs/nginx.pid; |
https://dev.classmethod.jp/tool/chrome-extension-plantuml-in-github-markdown-v1-2-0/
@startuml
title: Hello
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
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
<script> | |
const WORKER_RESOURCE = ` | |
self.onmessage = (event) => { | |
debugger; | |
postMessage(event.data + " worker"); // hello worker | |
}`; | |
const blob = new Blob( [ WORKER_RESOURCE ], { type: "application/javascript" } ); | |
const blobURL = URL.createObjectURL(blob); // -> URL.revokeObjectURL(blobURL); | |
const worker = new Worker(blobURL); |
個人的に 2012年頃(?)から渇望していた OffscreenCanvas と一連のAPIがついに Chrome に実装されました。
このエントリでは、UIの応答性を改善する OffscreenCanvas の仕組みと、 OffscreenCanvas を有効活用するための周辺APIについて、概要とサンプルコードを紹介していきます。
ネタ元はこちらです https://www.youtube.com/watch?time_continue=159&v=wkDd-x0EkFU
既存の <canvas>
は DOM と強く結びついている事から UI Thread(= ブラウザにおける Main Thread) の影響をうけますし、反対に影響を与えてしまいます。
影響: UI Thread で重い処理を走らせてしまうと、アニメーションのフレームスキップが発生し、なめらかにスクロールしなくなり、UIの応答性が悪くなるなどの弊害が発生してしまいます。
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
/* | |
json.forEach(async (raw) => { | |
const segment = new Segment(this._net); | |
await segment.init(raw); | |
this._hash[raw.id] = segment; | |
this._list.push(segment); | |
}); | |
*/ | |
await Promise.all( json.map(async (raw, index) => { | |
const segment = new Segment(this._net); |
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
export class Alert { | |
constructor(msg) { | |
alert(msg); | |
} | |
} |
<!DOCTYPE html><head><meta charset="utf-8"><title>MapView</title>
<style>html,body,map-view{height:100%;margin:10px}</style>
</head><body>
<map-view type="google" key="..."></map-view>
<script type="module" src="./app.js" charset="uft-8"></script>
</body>
</html>
NewerOlder