Skip to content

Instantly share code, notes, and snippets.

school school school busy busy help with homework please

--Explosion-- Explosion-Scratch

school school school busy busy help with homework please
View GitHub Profile
Explosion-Scratch / Password generator using master password.js
Created Nov 28, 2021
Generates passwords using a master password and the domain name.
View Password generator using master password.js
(async () => {
// ⇒
let hashed = await hash(`${location.hostname.split(".").slice(-2).join(".")} $ ${await passwd()}`);
[...document.querySelectorAll("input[type='password']")].forEach(i => (i.value = hashed));
//Async hashes using crypto API 😎
async function hash(string) {
// SHA-256 is better but generates too long passwords.
var buffer = await crypto.subtle.digest("SHA-1", new TextEncoder().encode(string));
//Make it have some symbols and stuff
Explosion-Scratch / Top 1m.json
Last active Nov 25, 2021
The top 1 million sites.
View Top 1m.json
Explosion-Scratch / Tiny helpers.json
Created Nov 21, 2021
A total JSON list of all the tiny helpers from stefanjudis/tiny-helpers
View Tiny helpers.json
"0to255.json": {
"name": "0to255",
"desc": "Lighten and darken colors easily",
"url": "",
"tags": [
"maintainers": [],
"addedAt": "2020-01-24"
Explosion-Scratch / Remove watch later.js
Created Nov 4, 2021
Remove all videos from watch later (YouTube)
View Remove watch later.js
PLEASE_STOP = false;
//set PLEASE_STOP to true to stop removing videos
while (window.PLEASE_STOP === false) {
document.querySelector("ytd-playlist-video-renderer .yt-icon-button").click();
await new Promise((r) => setTimeout(r, 100));
[...document.querySelectorAll("ytd-menu-popup-renderer tp-yt-paper-item")]
.find((i) => i.innerText.includes("Remove from"))
await new Promise((r) => setTimeout(r, 400));
Explosion-Scratch / Authenticator.js
Created Nov 2, 2021
Generates an authenticator token based on a secret key. (Usually given in the QR code that apps have you scan)
View Authenticator.js
async function getToken(key, options) {
let { default: JsSHA } = await import(
options = {
period: 30,
algorithm: "SHA-1",
digits: 6,
Explosion-Scratch / Compress string.js
Created Nov 1, 2021
Compress string using gzip and native browser APIs
View Compress string.js
function compress(string, encoding) {
const byteArray = new TextEncoder().encode(string);
const cs = new CompressionStream(encoding);
const writer = cs.writable.getWriter();
return new Response(cs.readable).arrayBuffer();
function decompress(byteArray, encoding) {
Explosion-Scratch / Favicon counter.js
Last active Oct 16, 2021
Shows a number in the favicon like Discord and Gmail do.
View Favicon counter.js
* Generates a data URL of the current favicon with a number added on top.
* @param {Object} options
* @param {String} [options.type = "image/png"] The mime type of the image to return.
* @param {String} [options.text = ""] The text to display on the favicon, if left blank will simply show a dot on the favicon.
* @param {String} [options.background = "white"] A CSS color for the background of the notification badge.
* @param {String} [options.color = "white"] A CSS color for the color of the text on the notification badge.
* @param {Number} [options.size = 10] The size of the notification badge. The badge generated will be size * 2 pixels in width and height, then added on top of the current favicon.
* @param {String} [options.pos = "bottom-right"] The position of the badge, either "bottom-right", "top-right", "bottom-left" or "top-left"
* @param {String} [options.font = "Monospace"] The font to use
Explosion-Scratch / Quizlet flashcards.js
Created Oct 12, 2021
Get Quizlet flashcards via API
View Quizlet flashcards.js
async function quizlet(id){
let res = await fetch(`${id}&filters%5BstudiableContainerType%5D=1&perPage=5&page=1`).then(res => res.json())
let currentLength = 5;
let token = res.responses[0].paging.token
let terms = res.responses[0].models.studiableItem;
let page = 2;
console.log({token, terms})
while (currentLength >= 5){
let res = await fetch(`${id}&filters%5BstudiableContainerType%5D=1&perPage=5&page=${page++}&pagingToken=${token}`).then(res => res.json());
Explosion-Scratch / mediastream.js
Last active Oct 12, 2021
Greenscreen effect on media stream using canvas
View mediastream.js
//Helper functions:
// get('type', stream) returns the audio or video track from a stream.
// createStream(...tracks) returns a stream with all the tracks provided as parameters
async function manipulate(videoTrack, fn) {
let canvas = document.createElement("canvas");
let running = true;
const ctx = canvas.getContext("2d");
let video = document.createElement("video");
video.setAttribute("autoplay", true);
video.setAttribute("muted", true);
View ripple.js
function ripple(el, opts = {}) {
const time = opts.time || (+el.getAttribute("data-time") || 1000) * 3;
const color = opts.color || el.getAttribute("data-color") || "currentColor";
const opacity = opts.opacity || el.getAttribute("data-opacity") || ".3";
const event = opts.event || el.getAttribute("data-event") || "click"; = "hidden"; = "relative";
el.addEventListener(event, (e) => {
if (el.disabled) return;
var ripple_div = document.createElement("DIV");