Skip to content

Instantly share code, notes, and snippets.

@Klaster1
Klaster1 / paint-likes.user.js
Last active August 5, 2023 19:40
Paint likes 🖌️🥰
// ==UserScript==
// @name Paint likes 🖌️🥰
// @description Like comments by pressing Shift while mouse curosor is over or hovering while Shift is down
// @version 1.2
// @grant none
// @match https://news.ycombinator.com/*
// @match https://www.youtube.com/*
// @match https://www.reddit.com/r/*/comments/*
// @match https://old.reddit.com/r/*/comments/*
// @icon data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🖌️</text></svg>
@piyush01123
piyush01123 / generatePassword.js
Last active March 21, 2023 23:14
Generate and copy to clipboard strong password - Tampermonkey script
// ==UserScript==
// @name Generate Strong Password
// @namespace http://tampermonkey.net/
// @version 3.1.1
// @description Strong password generator of size 12
// @author Piyush Singh
// @match *://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant unsafeWindow
// @grant GM_setClipboard
@Klaster1
Klaster1 / rarbg-captcha-solver.user.js
Last active August 5, 2023 19:41
Rarbg automatic captcha solver
// ==UserScript==
// @name Rarbg captcha solver
// @version 1.2
// @grant none
// @match https://*/threat_defence.php?defence=2*
// @require https://unpkg.com/tesseract.js@v2.1.0/dist/tesseract.min.js
// @run-at document-idle
// @author Klaster_1
// @icon https://rarbgenter.org/favicon.ico
// @downloadURL https://gist.github.com/Klaster1/dd7991d59fc8e6a7ec2544b47a12e4e9/raw/rarbg-captcha-solver.user.js
@piejanssens
piejanssens / youtube.com - Replace Apple Touch Icon.user.js
Last active October 9, 2022 13:22
Userscript: youtube.com - Replace Apple Touch Icon
// ==UserScript==
// @name Replace YouTube Apple Touch Icon
// @version 1.0.0
// @author piejanssens
// @match *://*.youtube.com/*
// @downloadURL https://gist.githubusercontent.com/piejanssens/aa2360de4d14233cb1e92d1a6864c6e6/raw/57f9b6496202139d42b41920e54186c77c33a3ea/youtube.com%2520-%2520Replace%2520Apple%2520Touch%2520Icon.user.js
// @updateURL https://gist.githubusercontent.com/piejanssens/aa2360de4d14233cb1e92d1a6864c6e6/raw/57f9b6496202139d42b41920e54186c77c33a3ea/youtube.com%2520-%2520Replace%2520Apple%2520Touch%2520Icon.user.js
// @homepage https://gist.github.com/piejanssens/aa2360de4d14233cb1e92d1a6864c6e6/
// ==/UserScript==
document.querySelectorAll("link[rel='apple-touch-icon-precomposed']").forEach(e => e.remove());
@JohnBra
JohnBra / useStorage.tsx
Created July 4, 2022 22:44
Typed React useStorage hook for chrome extensions
import { Dispatch, SetStateAction, useState, useEffect, useCallback, useRef } from 'react';
export type StorageArea = 'sync' | 'local';
// custom hook to set chrome local/sync storage
// should also set a listener on this specific key
type SetValue<T> = Dispatch<SetStateAction<T>>;
/**
const getRandomizedBoxes = ()=>{
const getRandomInt = (min,max)=>{
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min);
//The maximum is exclusive and the minimum is inclusive
}
const boxes = Array(100);
@x0a
x0a / redditvideoquality.user.js
Last active September 22, 2023 16:12
Forces the highest quality video on Reddit
// ==UserScript==
// @name Force highest resolution on Reddit
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Parses the mpd file sent to reddit's video player and removes all but the highest resolution representations for each video period
// @author x0a
// @run-at document-start
// @match https://www.reddit.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant none
@DungGramer
DungGramer / fastest_for.js
Last active October 16, 2023 06:40
Find fastest way to loop through an array in Javascript
const {performance} = require('perf_hooks');
// Create 1000 random numbers
const arr = length =>
Array.from({length}, () => Math.floor(Math.random() * 1000));
function record(arr) {
const result = [];
function timeRun(callback, message) {
@LearnWebCode
LearnWebCode / index.js
Created July 21, 2021 23:41
Puppeteer / Node.js Automation & Web Scraping Tutorial from YouTube
// in a new folder be sure to run "npm init -y" and "npm install puppeteer"
const puppeteer = require("puppeteer")
const fs = require("fs/promises")
async function start() {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto("https://learnwebcode.github.io/practice-requests/")
const names = await page.evaluate(() => {
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"comment.line",
"constant",
"constant.character",