This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const generate = (meta) => { | |
return [ | |
{ charset: "utf-8" }, | |
{ lang: "en" }, | |
{ name: "viewport", content: "width=device-width, initial-scale=1" }, | |
{ name: "format-detection", content: "telephone=no" }, | |
{ name: "title", content: meta.title }, | |
{ name: "author", content: meta.author }, | |
{ | |
name: "keywords", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | |
el.style.overflow = "hidden"; | |
el.style.position = "relative"; | |
el.addEventListener(event, (e) => { | |
if (el.disabled) return; | |
var ripple_div = document.createElement("DIV"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function quizlet(id){ | |
let res = await fetch(`https://quizlet.com/webapi/3.4/studiable-item-documents?filters%5BstudiableContainerId%5D=${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(`https://quizlet.com/webapi/3.4/studiable-item-documents?filters%5BstudiableContainerId%5D=${id}&filters%5BstudiableContainerType%5D=1&perPage=5&page=${page++}&pagingToken=${token}`).then(res => res.json()); | |
terms.push(...res.responses[0].models.studiableItem); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compress(string, encoding) { | |
const byteArray = new TextEncoder().encode(string); | |
const cs = new CompressionStream(encoding); | |
const writer = cs.writable.getWriter(); | |
writer.write(byteArray); | |
writer.close(); | |
return new Response(cs.readable).arrayBuffer(); | |
} | |
function decompress(byteArray, encoding) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getToken(key, options) { | |
let { default: JsSHA } = await import( | |
"https://cdn.skypack.dev/pin/[email protected]/mode=imports,min/optimized/jssha.js" | |
); | |
options = { | |
period: 30, | |
algorithm: "SHA-1", | |
digits: 6, | |
timestamp: Date.now(), | |
...options, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) | |
.click(); | |
await new Promise((r) => setTimeout(r, 400)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"0to255.json": { | |
"name": "0to255", | |
"desc": "Lighten and darken colors easily", | |
"url": "https://www.0to255.com/", | |
"tags": [ | |
"Color" | |
], | |
"maintainers": [], | |
"addedAt": "2020-01-24" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["google.com","youtube.com","tmall.com","qq.com","baidu.com","sohu.com","taobao.com","360.cn","amazon.com","jd.com","facebook.com","yahoo.com","wikipedia.org","weibo.com","zoom.us","sina.com.cn","xinhuanet.com","live.com","microsoft.com","office.com","reddit.com","panda.tv","netflix.com","instagram.com","zhanqi.tv","google.com.hk","canva.com","csdn.net","myshopify.com","alipay.com","force.com","microsoftonline.com","vk.com","yahoo.co.jp","coinmarketcap.com","stackoverflow.com","naver.com","linkedin.com","bongacams.com","twitter.com","adobe.com","tianya.cn","bing.com","yy.com","ebay.com","huanqiu.com","salesforce.com","chaturbate.com","amazon.in","twitch.tv","whatsapp.com","aliexpress.com","amazon.co.jp","yandex.ru","17ok.com","1688.com","mail.ru","tiktok.com","dropbox.com","tradingview.com","wordpress.com","discord.com","aparat.com","tribunnews.com","babytree.com","etsy.com","msn.com","chase.com","indeed.com","zoho.com","walmart.com","spotify.com","upwork.com","google.co.in","freepik.com","amazonaws.com","pik |