Skip to content

Instantly share code, notes, and snippets.

View mdm508's full-sized avatar

Matthew McLaughlin mdm508

View GitHub Profile
@mdm508
mdm508 / gist:fd941c943acc4ecf209caf073ed77f16
Last active July 3, 2025 16:53
Tamper Monkey Sumo Math Short Cut Keys
// ==UserScript==
// @name SumoMath Input Enhancer + Modal Ad Dismisser (Numpad Support)
// @namespace http://tampermonkey.net/
// @version 1.8
// @description Keyboard shortcuts + automatic modal ad dismissal via OK button, now with numpad support
// @match https://sumomath.com/*
// @grant none
// ==/UserScript==
(function () {
@mdm508
mdm508 / gist:f5df058cf13db8a0a59ad36086a5ec5e
Created June 9, 2025 21:21
XGCartoon Tamper Monkey Ehancer
// ==UserScript==
// @name XGCartoon Enhancer Suite
// @namespace http://tampermonkey.net/
// @version 1.0
// @description All-in-one enhancement for xgcartoon: auto-close popups, toggle playback/UI, subtitle control, copy caption.
// @match https://www.xgcartoon.com/*
// @grant GM_setClipboard
// ==/UserScript==
(function () {
if(
/* Check if Size or Value is empty; if true, return 0 as invalid task */
empty(prop("Size")) or empty(prop("Value")),
0,
max(
0.01, /* Ensure the minimum value is greater than 0 */
floor(
(
/* Base priority: Value divided by _cost */
(toNumber(prop("Value")) / prop("Estimated Pomo")) *
@mdm508
mdm508 / cut.py
Created January 22, 2024 02:58
cut first part out of a bunch of audio files
#This cuts the first part off a bunch of audio files
#useful for annoying textbooks that feel the need to
#announce who the publisher is or play music
import os
import glob
import shutil
from pydub import AudioSegment
' macros for adding rules to outlook and then exectuing those rules
' Attribute VB_Name = "MyOutlookVBA"
' To enable Macros in Outlook 2016: Tools/Trust Center... and select Macro Security.
' Easiest thing is NO SECURITY CHECK. Can also select WARNINGS FOR ALL MACROS.
' ================================== Run Rules Macro ==================================
' To add as a button: Tools/Customize... then click on Macros category. Drag your macro to the toolbar.
' Rt Click on button to edit text. UPDATED for Outlook 2016 (changed FOR loop to use count; added on Error)
' This macro runs enabled ALL rules, not just those for the default store.
@mdm508
mdm508 / .gitignore
Created July 11, 2023 16:41 — forked from adamgit/.gitignore
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@mdm508
mdm508 / schedule.py
Last active April 3, 2020 20:13
Schedule tasks in file to Things 3
import webbrowser
from datetime import date, timedelta
# modify these constants to make it work
P = '/Users/f/Desktop/out.txt' #path to your txt file containing 1 per line chapter or section
PROJECT_NAME = 'Spoken Mandarin Chinese' #make sure this name matches project name in things3 exactly
SECTION_PER_DAY = 1 # how many sections you want to read per day
START_STUDY_DAY = 4 # what day of this week would you like to start studying (use current day number if today)
STUDY_DAYS = [0,2,4,6] # m=0,t=1,...sun=6. what days do you want to have your sections to read scheduled
@mdm508
mdm508 / custom_model_objects.swift
Last active October 17, 2019 20:57
Project from the App development with swift course. This code is meant to be run inside of a playground. It shows how json data can be loaded directly into a custom object. In this case, data from the Nasa picture of the day api is loaded into a PhotoInfo object.
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
struct PhotoInfo: Codable {
var title: String
var description: String
var url: URL
var copyright: String?
enum CodingKeys: String, CodingKey {
case title