Skip to content

Instantly share code, notes, and snippets.

View alex-md's full-sized avatar

Alex Johnson alex-md

  • Student
  • Phoenix, AZ
  • 17:21 (UTC -07:00)
View GitHub Profile
@alex-md
alex-md / OEIS.html
Created September 5, 2025 07:01
Complex numerical sequence estimation via a multiple model ensemble
<script src="https://cdn.tailwindcss.com"></script>
<!-- Chart.js script is no longer needed -->
<!-- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> -->
<div class="max-w-6xl mx-auto p-4 md:p-6">
<header class="mb-6">
<h1 class="text-2xl md:text-3xl font-semibold tracking-tight">
Smart Sequence Extrapolator
</h1>
<p class="text-slate-600 mt-2">

Graph & Network Algorithms

  • Dijkstra’s Pathfinding Visualizer – Watch shortest paths emerge on interactive maps/grids
  • A Search with Heuristics* – Compare different heuristic functions in real-time pathfinding
  • Network Flow Algorithms – Visualize max flow/min cut with animated water flowing through pipes
  • Minimum Spanning Tree Builder – Interactive Kruskal’s/Prim’s with edge weights and forest growth
  • Topological Sort Visualizer – Drag-and-drop course prerequisites to see valid orderings

Sorting & Searching

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Natural Keyword Inserter</title>
<style>
body {
font-family: sans-serif;
line-height: 1.6;
@alex-md
alex-md / tmp
Created February 24, 2024 19:54
https://tmpfiles.org/dl/4304799/b4796aac-3825-4a88-bbbc-6b6cc3bdf100_untitled.pdf
// Function to evaluate XPath and return matching elements
function evaluateXPath(xpath, contextNode) {
const iterator = document.evaluate(xpath, contextNode || document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
let result = [], node;
while (node = iterator.iterateNext()) result.push(node);
return result;
}
// Template XPaths with placeholders for iterating
const titleXPathTemplate = "/html/body/div/div[1]/div/div/div/div[{i}]/div/span";
@alex-md
alex-md / draw_circle.py
Created December 19, 2023 06:29
Draw circle
import pyautogui
import math
import time
def draw_circle():
# Set the delay after each PyAutoGUI call to 0.01 for a 10ms delay
pyautogui.PAUSE = 0.01
# Step 1: Wait for 3 seconds
@alex-md
alex-md / sort_files_by_ext.py
Created October 9, 2023 19:18
Sorting files recursively in a specified directory
"""
This module contains code for sorting files in a directory by their file extension.
"""
import os
import shutil
from collections import defaultdict
def move_files_to_root(root_folder, current_folder):
@alex-md
alex-md / pathfinder.js
Created March 9, 2023 18:40
p5.js pathfinder
/* Pathfinding Visualizer using P5.js*/
const grid = [];
const cols = 50;
const rows = 35;
// cell size should be calculated based on number of rows and cols
const cellSize = 10;
let start;
let end;
let path = [];

Question 01 There exists a staircase with N steps, and you can climb up either 1 or 2 steps at a time. Given N, write a function that returns the number of unique ways you can climb the staircase. The order of the steps matters.

For example, if N is 4, then there are 5 unique ways: 1, 1, 1, 1 2, 1, 1 1, 2, 1 1, 1, 2 2, 2 What if, instead of being able to climb 1 or 2 steps at a time, you could climb any number from a set of positive integers X? For example, if X = {1, 3, 5}, you could climb 1, 3, or 5 steps at a time.

@alex-md
alex-md / read_all.js
Created September 22, 2022 17:35
Halo read all
javascript:for(var n=document.getElementsByTagName("span"),e=0;e<n.length;e++)"Unread"==n[e].innerHTML&&n[e].click()