Skip to content

Instantly share code, notes, and snippets.

@dpoeschl
dpoeschl / gist:13df8a282537a9a42840
Last active November 21, 2018 03:46
Time humanity has spent watching a youtube video.
// Example output from 'Luis Fonsi - Despacito ft. Daddy Yankee (Official Music Video)' (https://www.youtube.com/watch?v=kJQP7kiw5Fk):
// "Max time: 51067 years; Time if all views made it to 63 seconds: 11429 years (+181 years per second)."
player = document.getElementById("movie_player");
currentTime = player.getCurrentTime();
duration = player.getDuration();
views = parseInt(document.getElementsByClassName("view-count")[0].innerHTML.replace(/,/g, ""));
maxTimeInYears = Math.round(views * duration / 60 / 60 / 24 / 365);
currentPositionTimeInYears = Math.round(views * currentTime / 60 / 60 / 24 / 365);
yearsPerSecond = Math.round(views / 60 / 60 / 24 / 365);
@dpoeschl
dpoeschl / gist:7924130
Created December 12, 2013 06:56
Could be better, but I had to have one that showed the words as they're spoken. For the inspiration: https://gist.github.com/fekberg/bac40e784113dd75c03e
// Expanded on Filip Ekberg's gist: https://gist.github.com/fekberg/bac40e784113dd75c03e
// See his tweet @fekberg for more https://twitter.com/fekberg/status/410964845870071808
// Not perfect, but still amusing.
using System;
using System.Media;
using System.Speech.Synthesis;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
@dpoeschl
dpoeschl / gist:3180274
Created July 26, 2012 04:36
Unremovable "== true ? true : false"
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine(new Program().M());
}
bool M()