Skip to content

Instantly share code, notes, and snippets.

View maddisondesigns's full-sized avatar

Anthony Hortin maddisondesigns

View GitHub Profile
@maddisondesigns
maddisondesigns / secure_list.sh
Created June 13, 2026 05:58
macOS Command Line Zip Secure List Script using 7z
#!/bin/bash
# Secure List Script using 7z
# Requires: 7z (7-Zip) is not installed. Download it from 7-zip.org
# Exit on error or undefined variable
set -euo pipefail
# Specify the folder location of the 7zip executable file
ZIPLOCATION=$HOME"/Downloads/7Zip"
@maddisondesigns
maddisondesigns / secure_extract.sh
Last active June 13, 2026 05:57
macOS Command Line Zip Secure Extract Script using 7z
#!/bin/bash
# Secure Extract Script using 7z
# Requires: 7z (7-Zip) is not installed. Download it from 7-zip.org
# Exit on error or undefined variable
set -euo pipefail
# Specify the folder location of the 7zip executable file
ZIPLOCATION=$HOME"/Downloads/7Zip"
@maddisondesigns
maddisondesigns / secure_zip_split.sh
Last active June 13, 2026 05:57
macOS Command Line Zip script using 7z with max compression, AES-256, header encryption & PW Protection, also splitting zip into 500MB volumes
#!/bin/bash
# Secure Encrypt Script using 7z and splitting zip into 500MB volumes
# Requires: 7z (7-Zip) is not installed. Download it from 7-zip.org
# Exit on any error
set -euo pipefail
# Specify the folder location of the 7zip executable file
ZIPLOCATION=$HOME"/Downloads/7Zip"
@maddisondesigns
maddisondesigns / secure_zip.sh
Last active June 13, 2026 05:57
macOS Command Line Zip script using 7z with max compression, AES-256, header encryption & PW Protection
#!/bin/bash
# Secure Encrypt Script using 7z
# Requires: 7z (7-Zip) is not installed. Download it from 7-zip.org
# Exit on any error
set -euo pipefail
# Specify the folder location of the 7zip executable file
ZIPLOCATION=$HOME"/Downloads/7Zip"
@maddisondesigns
maddisondesigns / 7zip.sh
Last active June 13, 2026 05:57
macOS Command Line Zip script using 7z
#!/bin/bash
# Zip Script using 7z
# Requires: 7z (7-Zip) if not installed. Download it from 7-zip.org
# Exit on any error
set -euo pipefail
# Specify the folder location of the 7zip executable file
ZIPLOCATION=$HOME"/Downloads/7Zip"
@maddisondesigns
maddisondesigns / functions.php
Last active June 10, 2026 06:40
Automatically set WordPress Administration Color Scheme to previous default (Fresh) colour scheme for a specific user
/**
* Automatically set Administration Color Scheme to previous default (Fresh) colour scheme for a specific user
* Replace [insert_username_here] with the relevant username
*/
function set_admin_color_scheme( $color_scheme ) {
$current_user = wp_get_current_user();
if ( strtolower( '[insert_username_here]' ) === strtolower( $current_user->user_login ) ) {
return 'fresh';
}
return $color_scheme;
@maddisondesigns
maddisondesigns / functions.php
Created June 10, 2026 06:12
Automatically set WordPress Administration Color Scheme to previous default (Fresh) colour scheme, for all users
/**
* Automatically set Administration Color Scheme to previous default (Fresh) colour scheme, for all users
*/
function set_admin_color_scheme( $color_scheme ) {
return 'fresh';
}
add_filter( 'get_user_option_admin_color', 'set_admin_color_scheme', 10 );
@maddisondesigns
maddisondesigns / functions.php
Last active June 22, 2026 20:45
Disable AI Support and Remove Connectors Screen in WordPress
/**
* Redirect the new AI Settings > Connectors screen back to the Dashboard so it can't be accessed
*/
function mytheme_admin_redirects() {
global $pagenow;
/* Redirect Connectors screen back to main Dashboard page */
if( $pagenow == 'options-connectors.php' ) {
wp_redirect( admin_url( '/' ), 301 );
exit;
@maddisondesigns
maddisondesigns / MacOS Finder Touch Quick Action.md
Last active May 31, 2026 09:21
MacOS Automator Quick Action for Touching a File/Folder

Create a new Quick action using MacOS Automator that allows you to "touch" a file or folder

  1. Open up Automator.app from your Applications folder or through Launchpad
  2. Create a new workflow using File > New (⌘N)
  3. Choose ”Quick Action” in the dialog sheet when creating a new document
  4. In the Workflow receives current dropdown menu at the top of the "Canvas" on the right, select ”Files or Folders”.
  5. In the sidebar to the left, search for Get Selected Finder Items
  6. Drag this Action to the "canvas" on the right side
  7. In the sidebar to the left, search for Run Shell Script
  8. Drag this Action to the "canvas" on the right side
@maddisondesigns
maddisondesigns / ConvertFlacToM4A.sh
Last active December 23, 2025 06:42
Convert FLAC to M4A (AAC/ALAC) with ffmpeg
#!/bin/bash
#
# Convert FLAC to M4A with ffmpeg
# Usage: convert_music.sh source_dir destination_dir
# Requires: ffmpeg - https://ffmpeg.org/download.html
#
# Author: Rick Makes - https://www.rickmakes.com/batch-convert-lossless-audio-to-aac-shell-script/
# Modified: Anthony Hortin
#