Skip to content

Instantly share code, notes, and snippets.

@Explosion-Scratch
Explosion-Scratch / Bard Copy Button.user.js
Last active December 18, 2023 16:17
Add a copy button to bard's responses
// ==UserScript==
// @name Bard copy button
// @namespace mailto:explosionscratch@gmail.com
// @version 0.1
// @description Add a copy button to Google Bard's response without clicking more
// @author Explosion-Scratch
// @match https://bard.google.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=bard.google.com
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Bard
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://*.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=textarea.online
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// ==/UserScript==
import fs from 'fs';
import { exec, execSync } from 'child_process';
import { join } from 'path';
import path from 'path';
const args = process.argv.slice(2);
if (!process.env.SUDO_UID) {
console.log('Re-run as sudo');
process.exit(1);
@Explosion-Scratch
Explosion-Scratch / ChatGPT Auto Send.md
Last active December 26, 2025 00:22
Use ChatGPT as a custom search engine in Chrome - ChatGPT Auto Send

ChatGPT Auto Send

chatgpt_search_demo.mp4

Allows using ChatGPT as a search engine or to summarize transcripts (https://chat.openai.com/?query=%s, e.g. https://chat.openai.com/?query=how large is the sun).

You can also use it with Claude, for example https://claude.ai/chats?query=hello.

There's also ?transcript and ?copied. copied uses the prompt from your clipboard (you might have to click "Allow" on the notif asking permission), and transcript hides miscellaneous UI elements and writes an article based on a video transcript instead of using the default prompt.

@Explosion-Scratch
Explosion-Scratch / Set mac accent colors based on wallpaper.ts
Last active August 13, 2023 18:35
Set the mac accent color to the closest matching color that matches your wallpaper
#!/usr/bin/env deno
import Vibrant from "npm:node-vibrant"
import cd from "npm:color-difference"
const COLORS: { [number | string]: string } = {
4: "#336ED1",
5: "#7F2689",
6: "#B95081",
0: "#AC312D",
@Explosion-Scratch
Explosion-Scratch / ChatGPT for google userscript.user.js
Last active September 30, 2025 16:49
ChatGPT userscript for google with web access, code copy and more
// ==UserScript==
// @name ChatGPT google
// @namespace mailto:explosionscratch@gmail.com
// @version 0.1
// @description Adds a ChatGPT response box to google
// @author You
// @match https://www.google.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant GM_xmlhttpRequest
// @grant GM_getValue
@Explosion-Scratch
Explosion-Scratch / Auto install node modules.js
Last active July 22, 2023 13:47
Auto install node modules from a file
#!/usr/bin/env node
// Usage:
// autoinstall file.js --manager pnpm
// autoinstall file1.js file2.js
// Build to binary: esbuild index.js --bundle --outfile=build.cjs --format=cjs --platform=node && pkg -t node16-linux,node16-win,node16-macos-x64,node16-macos-arm64 build.cjs -C GZip -o autoinstall && rm -rf build.cjs
import fs from "fs/promises";
import path from "path";
@Explosion-Scratch
Explosion-Scratch / bard.js
Created May 2, 2023 13:46
Bard Client for use in Userscripts/Extensions
class BardBot {
/**
* The conversation context.
* @type {Object}
*/
conversationContext = undefined
/**
* The logging function.
* @type {Function}
*/
@Explosion-Scratch
Explosion-Scratch / stars.js
Created April 2, 2023 20:28
Top Stars of a GitHub README Repo list =) (make sure to replace TOKEN_GOES_HERE)
let repos = [...document.querySelectorAll("#readme a")]
.map((i) => i.href)
.filter((i) => !i.includes(location.host + location.pathname))
.filter((i) => i.includes("github.com/"))
.map((i) => i.split("/"))
.filter((i) => i.length === 5);
fetch("https://api.github.com/graphql", {
body: JSON.stringify({
query: `query repos {\n${repos
@Explosion-Scratch
Explosion-Scratch / backup_repo
Last active March 16, 2023 14:14
Backup a folder to a GitHub URL without deleting history on the repo or messing with merge conflicts → Keep local changes
#!/bin/bash
stop(){
echo "Stopping"
exit 1
}
cont(){
echo "Waiting 10 seconds"
sleep 10
}