Skip to content

Instantly share code, notes, and snippets.

@dotcomboom
dotcomboom / gophermirror.py
Last active Jul 24, 2022
Gopher directory mirroring with pituophis
View gophermirror.py
import pituophis
import os
from time import sleep
menus_to_download = ['gopher://'] # put your starting menu url here
sleep_between_downloads_sec = 0.1
def download_menu(url):
req = pituophis.parse_url(url)
text = req.get().text()
@dotcomboom
dotcomboom / memorize-me.py
Created Feb 12, 2022
Memorization wizard - takes docx file as input, outputs memorization-friendly versions
View memorize-me.py
# This is a python script that reads an Office DOCX file,
# and writes a copy of the file that is changed in that
# every word that is not bolded or italicized is replaced
# with the first letter of the word.
# Imports.
from docx import Document
import re
import sys
import os
@dotcomboom
dotcomboom / mp3guess.py
Created Feb 5, 2022
Batch mp3guessenc script, outputs a plot
View mp3guess.py
# python script to check using mp3guessenc every mp3 file in a directory and guess the encoding
# it will get the output from mp3guessenc, and parse out the text after "Maybe this file is encoded by"
import os
import subprocess
import sys
import re
# make a fancy graph of the results
import matplotlib.pyplot as plt
import numpy as np
View mpd_schedule.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# IMPORTS
from mpd import (MPDClient, CommandError)
from random import choice
from socket import error as SocketError
import sys
from sys import exit
import time
View Neopets- Custom art-aliases.user.js
// ==UserScript==
// @name Neopets: Custom art/aliases
// @namespace http://lince.somnolescent.net
// @version 0.1
// @description Replace the art and name shown for pets on the beta home page
// @author metalynx
// @match http://www.neopets.com
// @match http://www.neopets.com/
// @match http://www.neopets.com//
// @match http://www.neopets.com/index.phtml
View main.cpp
#include <sstream>
#include <iostream>
#include "windows.h."
using namespace std;
struct timer {
int minutes;
int seconds;
bool active;
string s;
View Neopets: Shop Stock Pricer.user.js
// ==UserScript==
// @name Neopets: Shop Stock Pricer
// @namespace http://lince.somnolescent.net
// @version 0.2
// @description This script lets you scrape JellyNeo for prices on the shop stock page. Does not auto-submit or otherwise automate activities, though it does send a bunch of search requests to JN when run. Use at your own risk.
// @author metalynx
// @match http://www.neopets.com/market.phtml?order_by=id*
// @match http://www.neopets.com/market.phtml?type=your*
// @icon https://www.google.com/s2/favicons?domain=neopets.com
// @require https://cdn.jsdelivr.net/npm/axios@~0.21.1/dist/axios.min.js
@dotcomboom
dotcomboom / aaaahhhhh.py
Created Apr 4, 2021
A script for extracting links from my daily notes
View aaaahhhhh.py
import marko
import os
import urllib.parse
from dateparser import parse
from bs4 import BeautifulSoup
from datetime import time
import requests
cupboard = "Daily"
epichtml = "<h1>HELLOOOOOO</h1>"
View MainWindow.xaml
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Pocowrite" Height="176" Width="435">
<Grid Background="#40444b">
<InkCanvas Margin="12,12,12,38" Name="InkCanvas1" Background="#36393f" MinHeight="1" MinWidth="1" />
<Button Content="Copy" HorizontalAlignment="Left" Margin="12,0,0,12" Name="CopyBtn" Width="75" Height="23" VerticalAlignment="Bottom" />
<Button Content="Clear" HorizontalAlignment="Right" Margin="0,0,12,12" Name="ClearBtn" Width="75" Background="#FFDDDDDD" Height="23" VerticalAlignment="Bottom" />
</Grid>
</Window>
@dotcomboom
dotcomboom / MoodleCurrent.user.js
Last active Sep 29, 2020
Moodle: Jump to Current Section
View MoodleCurrent.user.js
// ==UserScript==
// @name Moodle: Jump to Current Section
// @version 0.1
// @description Userscript for Moodle sites that lets you quickly jump to the current week/section. Made for the Boost and Fordson themes.
// @author dotcomboom
// @match *://*/course/view.php?id=*
// @grant none
// ==/UserScript==
(function() {