Skip to content

Instantly share code, notes, and snippets.

View bazuzu931's full-sized avatar
💭
you're tearing me apart lisa!

bazuzu931 bazuzu931

💭
you're tearing me apart lisa!
View GitHub Profile
@bazuzu931
bazuzu931 / README.md
Created December 13, 2023 09:40 — forked from denilsonsa/README.md
Embed VTT subtitles into HTML

Objective

I have a video file on my local disk. I also have some subtitles (in HTML5's [WebVTT][] format).

I want to create an HTML file to play that video with subtitles, all from the local filesystem.

Problem

Loading an external VTT file from the local filesystem [fails due to same-origin policy][q].

@bazuzu931
bazuzu931 / delayedForEach.js
Created July 22, 2020 12:33 — forked from fernandosavio/delayedForEach.js
An Array forEach with a delay between steps.
/**
* An array forEach with a delay between steps.
*
* @param {Function} callback Function to execute for each element. It receives three arguments, the element value, the element index and the array being traversed, respectivily.
* @param {Number} timeout Number of milliseconds that the function call should be delayed by.
* @param {Object} thisArg Object to use as this when executing callback.
* @this {Array}
* @return {undefined}
*/
Array.prototype.delayedForEach = function(callback, timeout, thisArg){