Skip to content

Instantly share code, notes, and snippets.

View PhantomOffKanagawa's full-sized avatar

Harrison Surma PhantomOffKanagawa

View GitHub Profile
@PhantomOffKanagawa
PhantomOffKanagawa / canvas-todoist-link.py
Last active April 29, 2025 01:45
CanvasTodoistConnector
@PhantomOffKanagawa
PhantomOffKanagawa / scraper.py
Last active December 25, 2024 08:53
Lego New Product Scraper
"""
Description:
This script scrapes the LEGO website for new, pre-order, coming soon, available, out of stock, and back order sets. It sends notifications to a Discord channel when new sets are found or when the status of existing sets changes. The script uses BeautifulSoup for web scraping and requests for making HTTP requests. It also uses a JSON file to keep track of notified sets and their statuses.
Functions:
- setup_storage(): Initializes the storage file for notified sets if it doesn't exist.
- load_notified_sets(): Loads the notified sets from the storage file.
- save_notified_sets(notified_sets): Saves the notified sets to the storage file.
- is_set_notified(set_id, notified_sets): Checks if a set has already been notified.
- mark_set_as_notified(set_id, status, notified_sets): Marks a set as notified and saves the status.
- send_discord_notification(set_name, set_image, set_price, set_url, status): Sends a notification to a Discord channel.
@PhantomOffKanagawa
PhantomOffKanagawa / gym_schedule.pl
Created November 14, 2024 20:23
Prolog Gym Schedule Generator
% Define the week
day(sunday).
day(monday).
day(tuesday).
day(wednesday).
day(thursday).
day(friday).
day(saturday).
% Define the workouts that must be separated
@PhantomOffKanagawa
PhantomOffKanagawa / minified-password-game.js
Created September 28, 2023 01:45
Bookmarklet for helping beat the password game on https://neal.fun/password-game/, minify and add (or copy minified version) to a bookmarklet to get the first 23 rules completed
javascript:const settings={feed:!0,fightFire:!0,captcha:!0,geo:!0,chess:!0,elements:!0};(function(){function l(u,i){var d=document;if(!d.getElementById(i)){var s=d.createElement('script');s.src=u;s.id=i;d.body.appendChild(s);s.addEventListener('load',fireWatch);s.addEventListener('load',feed);s.addEventListener('load',starter);s.addEventListener('load',captcha);s.addEventListener('load',geo);s.addEventListener('load',chess);s.addEventListener('load',elements)}}l('//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js','jquery');let previous='';function fireReplacer(match,offset){console.log(previous+' '+previous.charAt(offset));return previous.charAt(offset)}function fireWatch(){let timeout=setTimeout(fireWatch,200);if(settings.fightFire==true&&$('.ProseMirror p:first-child')[0].innerText.match('🔥')!=null){$('.ProseMirror p:first-child')[0].innerText=$('.ProseMirror p:first-child')[0].innerText.replace('🔥',fireReplacer);settings.fightFire=0;clearTimeout(timeout)}previous=$('.ProseMirror p:first-child')[0
@PhantomOffKanagawa
PhantomOffKanagawa / MMM-PetFinder.js
Created January 7, 2023 08:48
Updated PetFinder & node_helper for mykle1's MMM-PetFinder Magic Mirror Module
/* Magic Mirror
* Module: MMM-Petfinder
*
* By Mykle1
*
*/
Module.register("MMM-PetFinder", {
// Module config defaults.
defaults: {