Skip to content

Instantly share code, notes, and snippets.

View Explosion-Scratch's full-sized avatar

--Explosion-- Explosion-Scratch

View GitHub Profile
@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
}
// ==UserScript==
// @name Screenshots!
// @version 0.1
// @description Take screenshots in LittleBigSnake by pressing the shift key!
// @author Explosion-Scratch
// @match https://littlebigsnake.com/
// @icon https://www.google.com/s2/favicons?domain=littlebigsnake.com
// @grant none
// ==/UserScript==
(function() {
@Explosion-Scratch
Explosion-Scratch / Generate hosts file.js
Last active March 16, 2023 14:20
Generate hosts file with IPv4 and IPv6 support, mac
const fs = require("fs");
const a = require("child_process");
const excluded = [
// Breaks google drive
"clients6.google.com",
];
(async () => {
const hostname = a.execSync("hostname").toString().trim();
@Explosion-Scratch
Explosion-Scratch / instructions.md
Created January 6, 2023 17:23
Install microsoft store via UTM Virtual Machine (M1 Mac tested)

Steps

  • Download this zip file
  • Extract it and run the storeX86 file
  • Go through the installation process, click yes/finish a bunch of times
  • Microsoft store should be installed!
[
"rgba(149, 157, 165, 0.2) 0 8px 24px",
"0 7px 29px 0 rgba(100,100,111,.2)",
"rgba(0,0,0,.15) 1.95px 1.95px 2.6px",
"0px 5px 15px rgba(0, 0, 0, 0.35)",
{
"boxShadow": "rgba(0, 0, 0, 0.16) 0 1px 4px",
"credits": "3drops"
},
"rgba(0, 0, 0, 0.24) 0 3px 8px",
@Explosion-Scratch
Explosion-Scratch / Reset Chromebook sudo password.md
Created August 21, 2022 13:16
Reset Chromebook sudo password when you forgot/somehow don't know it.
  1. Open up shell with Control + Alt + T
  2. Enter vmc start termina
  3. You should see something like this: image
  4. Enter lxc start [your_linux_username] (don't worry if this says it's already started)
  5. Enter lxc exec bash -> Now you have a bash root session!
  6. Enter passwd [your_linux_username to set the sudo password, then just passwd to set the root password
  7. Done!
! name: JavaScript goggles
! description: Search JavaScript websites better
! public: true
! author: Explosion-Scratch
! avatar: #F0DB4F
$boost=3,site=github.io
$boost=10,site=developer.mozilla.org
$boost=10,site=stackoverflow.com
$boost=5,site=geeksforgeeks.org
@Explosion-Scratch
Explosion-Scratch / hotreload.js
Created July 10, 2022 19:26
Hotreload a page (uses fetch to check for updates, automatically senses resources)
(async ({
interval = 500,
method = "fetch",
useIframe = false,
resources = [],
autoDetect = true,
resourceTypes = ["navigation", "script", "resource", "link", "img", "other"],
}) => {
if (autoDetect) {
resources = performance
const permissions = {
async add(permission = [], origins = []){
if (!origins?.length){origins = undefined};
if (typeof permission === "string"){permission = [permission]};
return new Promise((r, reject) => {
chrome.permissions.request(
{permissions: permission, origins},
(granted) => {
if (!granted){
reject("Permission not granted");