Skip to content

Instantly share code, notes, and snippets.

Benedict Chen benedictchen

Block or report user

Report or block benedictchen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@benedictchen
benedictchen / resetPackageLock.sh
Created Jul 26, 2018
Reset all `package-lock.json` files
View resetPackageLock.sh
git status | grep '^.modified' | cut -d: -f2- | sed -e 's/^...//' | grep *package-lock.json | xargs git checkout --
@benedictchen
benedictchen / calculateYouTubePlaylistHours.js
Created May 6, 2018
Calculate YouTube Playlist Total Duration
View calculateYouTubePlaylistHours.js
const x = Array.prototype.map.call(document.querySelectorAll('iron-list#items .style-scope ytd-thumbnail-overlay-time-status-renderer'), ((node)=>node.textContent.trim()))
var seconds = x.map((item)=> {
let itemParts = item.split(':');
let str = itemParts[itemParts.length - 1] || 0;
return parseInt(str);
}).reduce((prev, current) => prev + current);
var minutes = x.map((item)=> {
let itemParts = item.split(':');
You can’t perform that action at this time.