Skip to content

Instantly share code, notes, and snippets.

View alekstar79's full-sized avatar
🎯
Focusing

Aleksey Tarasenko alekstar79

🎯
Focusing
View GitHub Profile
@alekstar79
alekstar79 / async-array.js
Last active May 24, 2024 16:19
Async array
export class AsyncArray extends Array
{
[Symbol.asyncIterator]()
{
let i = 0
return {
next: () => new Promise(resolve => {
setTimeout(() => resolve({ value: this[i], done: i++ === this.length }))
})
@alekstar79
alekstar79 / draggable.html
Last active May 24, 2024 16:57
Draggable
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Draggable</title>
<style>
.draggable {
position: absolute;