Skip to content

Instantly share code, notes, and snippets.

View angel333's full-sized avatar

Ondra Simek angel333

View GitHub Profile

The Best 18650 Batteries (last update: 2016-12-08)

This is similar to best18650battery.com but much simpler and better updated. These are the absolute top 18650s.

Name Model Capacity Discharge Fasttech links Note
Sony [US18650VTC6][d-vtc6] 3120mAh 30A [1pcs][vtc6-1], [2-pack][vtc6-2], [4-pack][vtc6-4]
LG Chem [INR18650MJ1][d-mj1] 3500mAh 10A [1pcs][mj1-1], [2-pack][mj1-2], [4-pack][mj1-4]
Sanyo (Panasonic) [NCR18650GA][d-ga] 3500mAh* 10A [1pcs][ga-1], [2-pack][ga-2], [4-pack][ga-4] NCR**
Samsung SDI [INR18650-35E][d-35e] >3350mAh 8A [1pcs][
@angel333
angel333 / youtube-playlist-duration.js
Last active August 15, 2021 19:33
Youtube playlist duration
// Just copy this into console while on a playlist page (https://www.youtube.com/playlist?list=.....)
alert(((document) => {
let seconds = Array.from(document.querySelectorAll('.pl-video-time .timestamp span'))
.map((span) => {
let time = span.textContent.split(':');
return (Number(time[0]) * 60) + Number(time[1]);
})
.reduce((a,b) => {
return a + b;
#!/bin/bash
#
# Certbot hook for Hurricane Electric DNS service
#
# Usage:
#
# Renew all certificates:
# HE_SESSID=<session_id> certbot renew \
# --preferred-challenges dns \
/*
* Simple hash function that uses Web Cryptography API
* @param {string} algo - SHA-1/SHA-256/SHA-384/SHA-512
* @param {string} text - text to compute digest from
* @return {Promise} - A promise returning text.
*/
function hash (algo, text) {
const encoded = new TextEncoder().encode(text);
return window.crypto.subtle.digest(algo, encoded)
.then(result =>