Skip to content

Instantly share code, notes, and snippets.

View nkev's full-sized avatar

Nuri nkev

  • Roland Corporation
  • Australia
View GitHub Profile
@tatsuyasusukida
tatsuyasusukida / !README-javascript-media-video.md
Last active April 23, 2024 03:14
🎥 How to record a video with JavaScript [demo video available]

🎥 How to record a video with JavaScript [demo video available]

Demo video: How to record a video with JavaScript

About this article

This article describes how to shoot a video from JavaScript using the MediaStream Recording API. The related resources are shown below.

@austinhyde
austinhyde / js-observables-binding.md
Last active August 16, 2023 18:19
Vanilla JavaScript Data Binding

Observables

You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:

var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }

console.log(getN()); // 5

setN(10);