Skip to content

Instantly share code, notes, and snippets.

View kpirnie's full-sized avatar
:bowtie:
I may be slow to respond.

Kevin Pirnie kpirnie

:bowtie:
I may be slow to respond.
View GitHub Profile
#EXTM3U
#EXTINF:0,1plus1
#https://1plus1-rakuten.amagi.tv/playlist.m3u8
#EXTINF:0,24hours Movies
https://muxip-24hoursmovies-klowdtv.amagi.tv/playlist.m3u8
#EXTINF:0,AccuWeather
https://amg00684-accuweatherinc-accuweather-stirr-69yvl.amagi.tv/playlist.m3u8
#EXTINF:0,Action Hollywood Movies
https://actionhollywood-klowdtv.amagi.tv/playlist.m3u8
#EXTINF:0,Agora TV
@kpirnie
kpirnie / request-json.py
Created August 13, 2025 18:09
JSON Request Python Class
#!/usr/bin/env python3
import json
import requests # type: ignore
from requests.adapters import HTTPAdapter # type: ignore
from urllib3.util.retry import Retry # type: ignore
import logging
from typing import Optional, Union, Any
from functools import partial
@kpirnie
kpirnie / functions.php
Created August 13, 2025 18:10
WordPress Security Fixes
<?php
/**
* Functionality to help mitigate some security issues.
*/
// We don't want to allow direct access to this
defined( 'ABSPATH' ) || die( 'No direct script access allowed' );
// prevent access to author archives on ID
add_action( 'init', function ( ) {
@kpirnie
kpirnie / wp-cron.sh
Created August 13, 2025 18:11
WordPress Server-Side Cron Replacement
#!/usr/bin/env bash
# hold the primary WP CLI command
WP_CLI="wp --allow-root --path="
# hold the starting path
_PATH=/home/*/htdocs/*
# loop over our home directory for the htdocs folder...
for d in $_PATH; do
@kpirnie
kpirnie / functions.php
Created August 13, 2025 18:12
PHP - Is It Really Empty?
/**
* is_it_empty
*
* Gets whether a variable is empty, null, or 'null'
*
* @since 7.4
* @access public
* @static
* @author Kevin Pirnie <[email protected]>
* @package Kevin's Spam Stop
@kpirnie
kpirnie / functions.php
Created August 13, 2025 18:13
PHP - String Word Search
/**
* string_contains_word
*
* PHP independant way to see if one string contains a specific word
*
* @since 7.4
* @access public
* @static
* @author Kevin Pirnie <[email protected]>
* @package Kevin's Spam Cop
@kpirnie
kpirnie / functions.php
Created August 13, 2025 18:14
WordPress - Create Admin
<?php
// include the wp-config.php file
include "/CHANGE_THIS_PATH/wp-config.php";
// set a username
$username = 'CHANGE_THIS';
// set a password
$password = 'CHANGE_THIS';
@kpirnie
kpirnie / functions.php
Created August 13, 2025 18:14
PHP - Mask Email Address
/**
* mask_email_address
*
* Mask an email address from bots
*
* @since 7.3
* @access public
* @static
* @author Kevin Pirnie <[email protected]>
* @package Kevin's CRM and Support
@kpirnie
kpirnie / functions.php
Created August 13, 2025 18:15
WordPress - Add Basic Auth to Remote Requests
/**
* function to filter the remote request arguments to ensure we are passing
* http auth headers when remotely calling from staging or dev environments
* only used if HOST of requested URL matches the site's home HOST and if the auth
* exists
*
* @param array $_the_args The existing arguments passed with the request.
* @param string $_the_url The URL being requested.
*
*/
@kpirnie
kpirnie / functions.php
Created August 13, 2025 18:17
WordPress - Pluginless Breadcrumbs
/**
* get_base_breadcrumbs
*
* Public method to return a html string of breadcrumb navigation
* checks for a couple plugins, then attempts to build one manually
*
* @since 7.4
* @access public
* @static
* @author Kevin Pirnie <[email protected]>