Skip to content

Instantly share code, notes, and snippets.

View ajoh504's full-sized avatar
🤖

Alex Johnson ajoh504

🤖
View GitHub Profile
@ajoh504
ajoh504 / pdfparanoia.py
Created September 25, 2022 15:24
PDF Paranoia - Automate the Boring Stuff With Python - CH 15
#!python3
# pdfparanoia.py - Walk through a directory and its subdirectories, and encrypt
# every PDF file. Provide the encryption password via command
# line and the filepath to search through. Check to see if
# encryption succeeded by attempting to read and decrypt the
# files. Prompt the user to delete the older unencrypted files.
#
# USAGE: sys.argv[1] = filepath to search for PDFs
# Using Python 3.10 and PyPDF2 v2.10.0
#
@ajoh504
ajoh504 / emailchores.py
Created September 25, 2022 15:33
Random Chore Assignment Emailer - Automate the Boring Stuff With Python - CH 18
#!python3
# emailchores.py - Scan a list of chores and a list of email addresses then
# randomly assign chores to people via email. Track recent
# chores so that the same chore is not assigned the following
# week.
#
# USAGE: Run script with --help or -h to view help information.
# Using Python 3.6 and EZGmail 2022.2.24
#
# SOURCE: https://automatetheboringstuff.com/2e/chapter18/
@ajoh504
ajoh504 / UndoableQueue.java
Last active December 1, 2023 15:27
Exercise 1.3.19 from Algorithms by Sedgewick and Wayne
/*
* From Algorithms 4th ed. by Sedgewick and Wayne, pg 164.
*
* Exercise 1.3.19 Give a code fragment that removes the last node in a linked list whose
* first node is first.
*
* Links to source:
* https://github.com/kevin-wayne/algs4
* https://algs4.cs.princeton.edu/home/
*
@ajoh504
ajoh504 / html.json
Last active August 2, 2023 12:55
HTML Template using VS Code Snippets
{
"html_template" : {
"body" : [
"<!DOCTYPE html>",
"<html lang=\"en-us\">\n",
" <head>",
" <meta charset=\"utf-8\">",
" <meta name=\"viewport\" content=\"width=device-width\">",
" <title></title>",