https://woo.com/document/subscriptions/develop/action-reference/
https://woo.com/document/woocommerce-memberships-admin-hook-reference/
| # Ensure python3 is install via brew | |
| brew install python | |
| # Check that it's showing up in terminal | |
| which python3 | |
| # If there's anything about python already in /usr/local/bin , delete it | |
| sudo rm -rf /usr/local/bin/python3 | |
| # Link the new install to that old location |
| <?php | |
| // Takes in a post_id and finds all ancestor/parent pages, and | |
| // then finds all child pages. Returns the family tree in an array and notes what level | |
| // the current post_id is located in. | |
| function get_all_parent_and_child_pages( $post_id ) { | |
| $ancestry_array = [ | |
| 'ancestors_top_to_curr' => [] | |
| ]; |
| <?php | |
| // Sort Admin Menu alphabetically | |
| add_filter( 'menu_order', function ($menu_ord) { | |
| global $menu; | |
| $menu_order_to_human_string_array = []; | |
| foreach( $menu_ord as $menu_ord_item ) { | |
| // Remove separators | |
| if( str_contains( $menu_ord_item, 'separator' ) ) { | |
| continue; |
| // When the page is ready | |
| window.addEventListener('load', function () { | |
| if (document.querySelector('body') !== null) { | |
| let allGfLabels = document.querySelectorAll('.gfield_label'); | |
| allGfLabels.forEach(label => { | |
| let labelContent = label.innerHTML; | |
| // Only start the cascade of replacements if there's definitely an opening HTML tag of that type in the string | |
| if( labelContent.includes("<a") ) { | |
| labelContent = labelContent.replace("<a", "<a"); |
| cd ~/.ssh | |
| nano id_rsa | |
| # paste private key into that file, then CTRL-O and CTRL-X to save and exit | |
| chmod 600 id_rsa | |
| ssh-add --apple-use-keychain id_rsa | |
| # Enter SSH password if relevant |
| <?php | |
| $date_start = date_create( '2023-05-16' ); | |
| // Localize date using current Locale | |
| $date_start = date_i18n( 'F j, Y', $date_start ); |
| REM Enable Dark Theme | |
| powershell -command "New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 1 -Type Dword -Force; New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -Type Dword -Force" |
| <?php | |
| // Takes in a WP Menu array (typically creatd by wp_get_nav_menu_items()) and returns | |
| // a structured associative array of the menu items. | |
| // Currently supports up to 3 levels of menu items. | |
| function generate_structured_menu($wp_nav_items) | |
| { | |
| $nav_items_structured = []; | |
| // Initial pass to add all parent items |
| # Start with the obvious | |
| sudo shutdown -r now | |
| # Check CPU/memory usage | |
| top | |
| # Get running services | |
| systemctl --type=service --state=running | |
| # Start restarting them |