Skip to content

Instantly share code, notes, and snippets.

View mhay10's full-sized avatar
💻
Shouting at my computer until it works

Maxwell Hay mhay10

💻
Shouting at my computer until it works
View GitHub Profile
@mhay10
mhay10 / download.py
Created March 11, 2023 19:49
Downloads playlists/albums from Deezer
from pydeezer.constants import track_formats
from pydeezer import Deezer, Downloader
import readline
import glob
import os
# Setup path autocomplete
def completer(text, state):
line = readline.get_line_buffer().split()
@mhay10
mhay10 / chapterize.py
Last active March 12, 2023 08:58
Chapterize downloaded audiobooks from audible chapters
import subprocess as sp
import requests
import readline
import glob
import os
import re
# Setup path autocomplete
def completer(text, state):
"use strict";
const sleep = (ms) => {
return new Promise((resolve) => setTimeout(resolve, ms));
};
const getUrl = async (page) => {
page.scrollIntoViewIfNeeded();
const img = page.querySelector("img");
await sleep(100);
@mhay10
mhay10 / brainfuck.cpp
Created May 8, 2022 04:05
A brainfuck interpreter I wrote in C++ for fun.
#include <fstream>
#include <iostream>
std::string minimize(std::string s) {
std::string res;
for (char c : s)
if ((std::string("[],.<>+-")).find(c) != std::string::npos)
res += c;
return res;
#!/bin/bash
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
if [ "$1" = "" ]; then
echo "Usage: $(basename $0) <audiobook url> <output dir - optional>"
exit 1
fi
book_url=$1