Skip to content

Instantly share code, notes, and snippets.

@wilmoore
wilmoore / html5-video-error-handling.html
Created August 4, 2012 00:08
HTML5 Video Playback Error Handling POC
<p><video src="tgif.vid" autoplay controls onerror="failed(event)"></video></p>
<p><a href="tgif.vid">Download the video file</a>.</p>
/*sinceHow
@Author Simone Luise
@Mail me@simoneluise.com
A simple function to calcunate how much time has elapsed since a date.
The funcion have only one attribute: "time".
Time must be a valid string for generate a new Data() object. Like:
@federicobucchi
federicobucchi / shuffle.js
Last active August 29, 2015 14:02
Array Shuffle
var arr = [ 1 , 2 , 3 , 4 , 5 ];
function shuffle( arr ) {
var inputArr = arr;
var shuffledArr = [];
var loops = inputArr.length;
var randomNumber;
for ( var i = 0; i < loops; i++ ) {
randomNumber = Math.floor( Math.random() * ( loops - i ) );