Skip to content

Instantly share code, notes, and snippets.

@ZReC
ZReC / crypto-aes-gcm.js
Created October 18, 2022 08:13 — forked from chrisveness/crypto-aes-gcm.js
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@ZReC
ZReC / gain
Created July 13, 2022 21:01 — forked from mxvin/gain
Simple Gain / Boost Volume on any website (Youtube, Vimeo, Twitch etc) video by only one click of bookmark button. Copy code below, then create new bookmark, and fill code below to location address.
javascript:var g_6z; function cI_6z(){ var ctx_6z = new AudioContext(); var el_6z = document.querySelector("video") ? document.querySelector("video") : document.querySelector("audio")? document.querySelector("audio"):alert('Media DOM not exist. Aborting.'); if (el_6z){ g_6z = ctx_6z.createGain(); g_6z.gain.value = 1; var src_6z = ctx_6z.createMediaElementSource(el_6z); src_6z.connect(g_6z).connect(ctx_6z.destination); var p = document.createElement("div"); p.innerHTML = `<div class=vpc_6z id=vpc_6z><style>.vpc_6z{float:right;width:25%;position:fixed;bottom:0;padding:20px 20px;z-index:9999999;background:#444;color:#fff}.vpc_6z-hide{position:fixed;background:#444;padding:0;width:80px;height:30px;bottom:0;z-index:999999}.vpi_6z-hide{display:none}</style><button%20onclick='d=document.getElementById("vpi_6z"),"vpi_6z"==d.getAttribute("class")?d.setAttribute("class","vpi_6z-hide"):d.setAttribute("class","vpi_6z"),c=document.getElementById("vpc_6z"),"vpc_6z"==c.getAttribute("class")?c.setAttribute("class","vpc_6z-hi