Created by fiddling with code written by Mathias Bynens for https://mothereff.in/js-variables
MIT License from his project should be honored.
REM NOTE that this does NOT uninstall ffmpeg when done | |
@echo off | |
setlocal enabledelayedexpansion | |
echo Current directory: %cd% | |
REM Set the download URL for FFmpeg | |
set "ffmpeg_url=https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip" |
Created by fiddling with code written by Mathias Bynens for https://mothereff.in/js-variables
MIT License from his project should be honored.
const source$ = Observable.interval(1000).take(3); // 0, 1, 2 | |
// waits 3 seconds, then logs "2". | |
// because the observable takes 3 seconds to complete, and | |
// the interval emits incremented numbers starting at 0 | |
async function test() { | |
console.log(await source$.toPromise()); | |
} |
const click$ = Observable.fromEvent(button, 'clicks'); | |
/** | |
* Waits for 10 clicks of the button | |
* then posts a timestamp of the tenth click to an endpoint | |
* using fetch | |
*/ | |
async function doWork() { | |
await click$.take(10) | |
.forEach((_, i) => console.log(`click ${i + 1}`)); | |
return await fetch( |
Observable.defer(async function() { | |
const a = await promiseDelay(1000).then(() => 1); | |
const b = a + await promiseDelay(1000).then(() => 2); | |
return a + b + await promiseDelay(1000).then(() => 3); | |
}) | |
.subscribe(x => console.log(x)) // logs 7 |
function getErroringPromise() { | |
console.log('getErroringPromise called'); | |
return Promise.reject(new Error('sad')); | |
} | |
Observable.defer(getErroringPromise) | |
.retry(3) | |
.subscribe(x => console.log); | |
// logs "getErroringPromise called" 4 times (once + 3 retries), then errors |
// An observable that emits 10 multiples of 100 every 1 second | |
const source$ = Observable.interval(1000) | |
.take(10) | |
.map(x => x * 100); | |
/** | |
* returns a promise that waits `ms` milliseconds and emits "done" | |
*/ | |
function promiseDelay(ms) { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('done'), ms); |
// An observable that emits 10 multiples of 100 every 1 second | |
const source$ = Observable.interval(1000) | |
.take(10) | |
.map(x => x * 100); | |
/** | |
* returns a promise that waits `ms` milliseconds and emits "done" | |
*/ | |
function promiseDelay(ms) { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('done'), ms); |
console.clear(); | |
const path = ["list", 0]; | |
const path0 = ["list", 20, 'name']; // ref ref | |
const path1 = ["list", [0, 1], "name"]; | |
const path2 = ["list", [0, 1, { from: 3, length: 2 }], "name"]; | |
const path3 = ["list", [0, 1, { from: 3, length: 2 }, { from: 7, to: 9 }], "name"]; | |
const path4 = ["list", { to: 5 }, ["name", "rating"]]; | |
const jsonGraph = { |
made with esnextbin