The logging class courtesy of https://github.com/thielicious/Logger
class Logger {
private
$file,
$timestamp;
public function __construct($filename) {
| <?php | |
| /** | |
| * Modification to allow the filtering of products in PW Bulk Edit based | |
| * upon the number of categories a product is in. | |
| * | |
| * REF: https://www.pimwick.com/pw-bulk-edit/ | |
| * | |
| * @author Stephen Feather | |
| * @copyright Copyright (c) 2023 | |
| */ |
| #!/bin/bash | |
| # Script: grep_and_remove.sh | |
| # Author: Stephen Feather | |
| # Co-author: OpenAI (ChatGPT) | |
| # Copyright (c) 2023 | |
| # All rights reserved. | |
| # License: CC-BY-SA (https://creativecommons.org/licenses/by-sa/4.0/) |
| /** | |
| * Parses the FFL number and extracts relevant information. | |
| * | |
| * @param {string} fflNumber - The FFL number to parse. | |
| * @returns {object} - An object containing the parsed FFL information or an error object. | |
| * If parsing is successful, the object will have the following properties: | |
| * - ffl_number: The full FFL number. | |
| * - region: The region of the FFL. | |
| * - irs_district: The IRS district of the FFL. | |
| * - fips_code: The FIPS code of the FFL. |
| /** | |
| * Parses the FFL number and extracts relevant information. | |
| * | |
| * @param string $fflNumber The FFL number to parse. | |
| * @return array An array containing the parsed FFL information or an error object. | |
| * If parsing is successful, the array will have the following keys: | |
| * - ffl_number: The full FFL number. | |
| * - region: The region of the FFL. | |
| * - irs_district: The IRS district of the FFL. | |
| * - fips_code: The FIPS code of the FFL. |
| <deviceMapping backends="rawInput;directInput;macosXSdl"> | |
| <productKey productId="1422" vendorId="1038" /> | |
| <productName vendorId="1038"> | |
| <keyword text="nimbus+" /> | |
| </productName> | |
| <category>gamepad</category> <!-- gamepad, wheel, joystick, farmWheel, farmSidePanel --> | |
| <buttonMappings> | |
| <buttonMapping physical="0" logical="0" label="A" /> | |
| <buttonMapping physical="1" logical="1" label="B" /> | |
| <buttonMapping physical="2" logical="2" label="X" /> |
| #!/bin/bash | |
| # | |
| # upload_and_run.sh | |
| # Author: Stephen Feather | |
| # Copyright (c) 2023 Stephen Feather | |
| # License: CC BY-SA 4.0 | |
| if [ -z "$1" ]; then | |
| echo "Error: URL argument is required." |
| UPDATE wp_postmeta | |
| SET meta_value = REPLACE(meta_value, 'FA-', '') | |
| WHERE meta_key = '_sku' | |
| AND meta_value LIKE 'FA-%' | |
| ORDER BY post_id DESC | |
| LIMIT 10000; |
| # Courtesy of Prosti (https://wordpress.stackexchange.com/users/88606/prosti) | |
| # Context (https://wordpress.stackexchange.com/a/250293/215668) | |
| function _20161224_printer( $r ){ | |
| $line = microtime(true)*10000 . ' ' . $r . "\n"; | |
| $fp = fopen( ABSPATH . 'hooks.txt', 'a+'); | |
| fwrite($fp, $line); | |
| fclose($fp); |
| #!/usr/bin/bash | |
| BASE_URL="https://myourdomain.com/files/" | |
| # We need to be able to trap breakouts | |
| trap exit_script INT | |
| function exit_script() { | |
| end=`date +%s.%N` | |
| runtime=$( echo "$end - $start" | bc -l ) |
The logging class courtesy of https://github.com/thielicious/Logger
class Logger {
private
$file,
$timestamp;
public function __construct($filename) {