Skip to content

Instantly share code, notes, and snippets.

View andyg2's full-sized avatar
🎯
Focusing

Andy Gee andyg2

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am andyg2 on github.
  • I am 74gee (https://keybase.io/74gee) on keybase.
  • I have a public key ASATrKdGwD2MAR_RimQK5KPdoheN7XGtC11rnvm02qR9rAo

To claim this, I am signing this object:

@andyg2
andyg2 / wrap.bat
Created December 16, 2023 17:35
One liner to wrap all mp4 files in a folder of the same name
for %F in (*.mp4) do @(md "%~nF" 2>nul && move "%F" "%~nF\")
@andyg2
andyg2 / wc-category-image-fallback.php
Created November 23, 2023 23:05
Override the WooCommerce subcategory thumbnail to fallback to a product image or the standard fallback image
<?php
/*
Plugin Name: WC Category Image Fallback
Description: WooCommerce Product Image Fallback for Categories.
Version: 1.0
Author: Andy Gee
*/
@andyg2
andyg2 / output.json
Last active October 28, 2023 00:52
A regulalr expression based JavaScript VCARD parser into a JSON
{
"adr": [
{
"meta": {
"TYPE": "INTL",
"TYPE1": "PARCEL",
"TYPE2": "WORK"
},
"value": [
"",
@andyg2
andyg2 / get_pages.php
Created September 15, 2023 05:56
Download Wordpress Page content from wp-json API
<?php
if (isset($_GET['host'])) {
define('WEBSITE_URL', 'https://' . $_GET['host']);
} else {
echo 'usage: get_pages.php?host=www.domain.com';
exit;
}
@andyg2
andyg2 / index.html
Created August 8, 2023 10:50
MediaPipe - Face Mesh
<div class="container">
<video class="input_video"></video>
<div class="canvas-container">
<canvas class="output_canvas" width="1280px" height="720px">
</canvas>
</div>
<div class="loading">
<div class="spinner"></div>
<div class="message">
Loading
@andyg2
andyg2 / wfscan.sh
Created July 6, 2023 22:03
Use WordFence's vulnerabilities API to determine if any directories match recently reported slugs (previous 30 days)
#!/bin/bash
# Usage: ./wfscan.sh /home/username/web/domain.com/public_html/wp-content/plugins
# Output (Clean)
# >>> Scanning /home/username/web/domain.com/public_html/wp-content/plugins
# >>> Nothing found.
# Output (Suspect)
# >>> Scanning /home/username/web/domain.com/public_html/wp-content/plugins
@andyg2
andyg2 / readme.md
Created May 20, 2023 13:03
Simple PHP Websocket

Running

Start in shell WebSocket server: php -q websockets.php

Start in shell WebSocket client: php -S 0.0.0.0:8000 websockets.html please use separated tab in terminal.

Test

@andyg2
andyg2 / check_git_changes.sh
Created April 13, 2023 07:08
Email if changes detected in directory
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <directory>"
exit 1
fi
directory="$1"
@andyg2
andyg2 / dgtepro-limit-sold-products.php
Created March 30, 2023 06:57
Limit WooCommerce Sold Products Display Quantity
<?php
/*
* Plugin Name: Limit Sold Products
* Description: Limits the number of sold out products that show up on the front end of your WooCommerce store
* Author: Andy Gee
* Author URI: https://dgte.pro
* Version: 1.0
* Plugin Slug: dgtepro-limit-sold-products
*/