Skip to content

Instantly share code, notes, and snippets.

View ShetlandJ's full-sized avatar
🏴

James ShetlandJ

🏴
View GitHub Profile
@ShetlandJ
ShetlandJ / index.js
Last active October 30, 2023 19:11
Primus Toasterland song download script
// This is a script to download all songs in a playlist from Toasterland. In order to accomplish this, you can either paste this script into the console tab of the Inspector, or you can run a minifier on this and add it as a bookmark, prefixing it with javascript: ...
// Full code with comments:
var scripts = document.querySelectorAll("script[type='text/javascript']");
// get the last script tag, which contains the player, and get the inner content.
var playerScript = null;
if (scripts) {
playerScript = scripts[scripts.length - 1];
playerScript = playerScript.textContent || playerScript.innerText
@ShetlandJ
ShetlandJ / deleteRedditComments.js
Last active April 13, 2023 14:26
Delete reddit comments on mass/bulk with javascript and Reddit Enhancement Suite
// PLEASE NOTE: this assumes that you have Reddit Enhancement Suite installed and you're on https://old.reddit.com/user/{yourUserName}/comments/
// This script will first grab all visible comments on the page, and then start deleting them.
// Eventually, once the list is exhausted, it will execute a scroll to event which will
// open up a new page of comments, and the deleteComments sequence will re-run.
// It also checks if the function has stopped running for any reason, and will attempt to re-run it.
const deleteComments = (() => {
const $domNodeToIterateOver = $('.del-button .option .yes');
let currentTime = 0;
@ShetlandJ
ShetlandJ / RecordingInput.vue
Last active May 20, 2022 13:32
Vue 3 - record audio and listen back to it immediately in the browser
// Here's a base implementation of recording audio and listening back to it instantly without having to save the file somewhere.
<script setup>
import { ref } from "vue";
import { convertToBlogUri } from "@/utils/helpers";
let device = null;
let recorder = null;
let chunks = [];
let recording = ref(false);