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
<template> | |
<!-- | |
First things first, the `:value` cannot be `v-model="value"` because it would | |
break reactivity. It's the same as assigning things directly to `value.value` | |
and as explained below, assigning the value needs to be done through the host | |
element (`host.value = '...'`). | |
Secondly, the `<select>` element emits its own `input` event that bubbles. | |
Unfortunately, the event is disguised under the custom element, and not the | |
`<select>` that actually triggered the value. This is due to the `shadowRoot` |
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 { pipeline } from 'stream/promises' | |
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) | |
const colorsGenerator = async function* () { | |
const values = [ 'yellow', 'orange', 'red', 'blue', 'purple', 'green' ] | |
for await (const color of values) { | |
yield color | |
await sleep(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
/** | |
* Create an array by calling an initializer on each element | |
* | |
* @param length {Number} length of the created array | |
* @param init {Function} callback to call on each element of the array | |
*/ | |
function array(length, init = index => 0) { | |
return Array.apply(null, { length }).map(Function.call, init) | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> | |
* { | |
box-sizing: border-box; |
First test is done using Docker Swarm configured so that the demo_web
service runs in 16 copies.
This is supposed to output the maximum performance because each single-process and single-threaded (as node.js is)
would be able to fully utilize the assigned CPU
$ siege http://localhost:5001
** SIEGE 4.0.4
** Preparing 25 concurrent users for battle.
The server is now under siege...^C
Lifting the server siege...
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
node_modules | |
dist | |
.git |
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
Construction parts: | |
4x 2040 V-Slot profile 300mm (https://www.v-slot.pl/profile-aluminiowe-vslot2040) | |
1x 2020 V-Slot profile 250mm (https://www.v-slot.pl/profile-aluminiowe-v-slot2020) | |
1x 2020 V-Slot profile 283mm (https://www.v-slot.pl/profile-aluminiowe-v-slot2020) | |
1x 2020 V-Slot profile 160mm (https://www.v-slot.pl/profile-aluminiowe-v-slot2020) | |
2x Angle Plate Corner Brace Flat T Shape (https://www.aliexpress.com/item/32839448854.html) | |
12x 2020 Corner Bracket Right Angle (https://www.aliexpress.com/item/33062886463.html) | |
43x block M5 T-nuts 2020 (https://www.aliexpress.com/item/32853189777.html) | |
12x drop-in M5 T-nuts 2020 (https://pl.aliexpress.com/item/33014140496.html) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Todo</title> | |
<script src="https://unpkg.com/vue"></script> | |
<style> | |
.todo { | |
cursor: pointer; |
NewerOlder