This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import cv2 | |
| import matplotlib.pyplot as plt | |
| from PIL import Image | |
| # adjust these variables as necessary | |
| dirname = "pix-for-crop" | |
| put_dirname = "cropped" | |
| simple_crop = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xml.etree.ElementTree as ET | |
| # Parse the XML file and get the root | |
| tree = ET.parse('wordpress_export.xml') | |
| root = tree.getroot() | |
| # Find the <channel> element | |
| channel = root.find('channel') | |
| total = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import asyncio | |
| from termcolor import cprint | |
| from pyppeteer import launch | |
| from pyppeteer_stealth import stealth | |
| import subprocess | |
| def page_content_vaild(page_content): | |
| excluded_strings = ["Page Not Found", "Human Verification", "About Lynx"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Loop over all m4b files in the current directory | |
| for input in *.m4b | |
| do | |
| # Print a message indicating the file being processed | |
| echo "Processing file $input..." | |
| # Use ffmpeg to convert the m4b file to a wav file | |
| ffmpeg -i "$input" "${input%.*}.wav" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function do_gutenberg( $content ) { | |
| $output_rendered = ""; | |
| $parsed_blocks = parse_blocks( $content ); | |
| if ( $parsed_blocks ) { | |
| foreach ( $parsed_blocks as $block ) { | |
| $output_rendered .= apply_filters( 'the_content', render_block( $block ) ); | |
| } | |
| } | |
| return ( $output_rendered ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| from skyfield.api import load | |
| from skyfield.framelib import ecliptic_frame | |
| from tzfpy import get_tz | |
| import pytz | |
| def human_moon(lat, lon): | |
| ts = load.timescale() | |
| # Get the current time in the specified timezone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Dumps a database table out to the screen or out a csv file. | |
| // add ?download=true to the url to download the file | |
| // Database credentials, table, filename, and timezone | |
| $db_host = ""; | |
| $db_user = ""; | |
| $db_pass = ""; | |
| $db_name = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: Gutenburger Upgrader | |
| * Author: Greg R. | |
| * Version: 0.0.1 | |
| */ | |
| /* | |
| This plugin tries to clean html up so that it can be directly converted into gutenberg as blocks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| input_file = 'wordpress_export_file.xml' | |
| item_per_output_file = 500 | |
| with open(input_file, 'r') as file: | |
| content = file.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function export_all_posts() { | |
| // Ensure the export function is available | |
| if (!function_exists('export_wp')) { | |
| require_once ABSPATH . 'wp-admin/includes/export.php'; | |
| } | |
| // Start output buffering | |
| ob_start(); | |
| // Call the export function |