Skip to content

Instantly share code, notes, and snippets.

@half-duplex
half-duplex / youtube-playlist-duration.js
Last active December 30, 2019 02:09 — forked from liaohuqiu/gist:4ee77b9b03afcdecc80252252378d367
Find duration of YouTube playlist
var pl_times = document.getElementsByClassName('pl-video-time');
var time = 0;
function toS(hms) {
var a = hms.split(':');
while (a.length < 3) {
a.unshift(0);
}
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
return seconds;

Keybase proof

I hereby claim:

  • I am half-duplex on github.
  • I am majordomo (https://keybase.io/majordomo) on keybase.
  • I have a public key ASDaUS5FnBMI1XdpCjI61RV1WBxzKEBOOcx-4mL8aU8t8Qo

To claim this, I am signing this object:

@half-duplex
half-duplex / __main__.py
Created May 14, 2015 04:08
jinja2 erb style __main__
# -*- coding: utf-8 -*-
"""
jinja2.__main__
~~~~~~~~~~~~~~~
Allows for simple rendering in the style of eRuby, accepting variables from
the environment.
:copyright: (c) 2015 by the Jinja Team.
:license: BSD, see LICENSE for more details.