Skip to content

Instantly share code, notes, and snippets.


Joel Lisenby JoelLisenby

View GitHub Profile
JoelLisenby / jbl_find_replace.php
Last active Apr 20, 2022
Find and Replace Title and Content for Specific Post Type in WordPress with WP_Query
View jbl_find_replace.php
/* Backup site first before using. This adds a menu to wp-admin so you can run the script.
*** Visiting this menu will automatically run the script!! ***
'jbl Find Replace',
'jbl Find Replace',
JoelLisenby / functions.php
Last active Feb 19, 2022
Remove Flash of Unstyled Content in WordPress using SiteOrigin Page Builder and Mega Menu
View functions.php
function head_fouc_script() {
<script>"visibility", "hidden", "important");
#mega-menu-wrap-primary #mega-menu-primary { /* these IDs may differ depending on the name of your menu. */
visibility: inherit; /* mega menu sets visibility visible and shows if you don't set this */
JoelLisenby /
Last active Aug 22, 2021
A simple Dynamic DNS script for use with crontab for Linode Domain DNS Records API using dig and linode-cli from python pip
wanip=`dig +short`
oldip=`linode-cli domains records-view $domainid $recordid --text --no-header --format="target"`
if [ $oldip != $wanip ]
linode-cli domains records-update $domainid $recordid --target $wanip
JoelLisenby / usps_accepted_at.php
Last active Jun 23, 2020
Simple PHP function to check if USPS package has been accepted / picked up using official USPS API
View usps_accepted_at.php
function usps_picked_up( $tracking_number ) {
if( empty( $tracking_number ) || !ctype_alnum( $tracking_number ) ) {
return false;
$user_id = "YOUR_USER_ID";
$usps_api_uri = "";
$xml = rawurlencode("<TrackRequest USERID=\"". $user_id ."\">
JoelLisenby / getUrlWithParams.js
Last active May 15, 2020
Add/update or Remove URL parameters from the provided URL
View getUrlWithParams.js
/* getUrlWithParams()
* Add/update or remove url parameters from the provided url.
* Example: getUrlWithParams({'tab':tab_name},['remove']);
var getUrlWithParams = function(url, add_update, remove = []) {
var url = new URL(url);
var splita ='&');
var params = {};
var merged = {};
JoelLisenby / WP-JSON-Parser.html
Last active Feb 28, 2020
View WP-JSON-Parser.html
<!doctype html>
const req = new XMLHttpRequest();
req.addEventListener('load', function(e) {
var response = JSON.parse( );
var page_html = response.content.rendered;
JoelLisenby / find_invisible_horizontal_scroll_elements.js
Last active Dec 13, 2019
JavaScript to find hidden horizontal scroll elements. Paste into browser JS console and hit enter.
View find_invisible_horizontal_scroll_elements.js
var docWidth = document.documentElement.offsetWidth;
function(el) {
if (el.offsetWidth > docWidth) {
JoelLisenby / off.reg
Created Jun 5, 2019 — forked from CHEF-KOCH/off.reg
Windows 10 ads, turn it off!
View off.reg
Windows Registry Editor Version 5.00
; Turn off File Explorer ads
; Turn off Start Menu suggestions
View hero_video.html
<div id="hero_video_container">
<video autoplay muted loop id="hero_video">
<source src="/videos/video.mp4" type="video/mp4" />
<source src="/videos/video.webm" type="video/webm" />
#hero_video_container {
position: relative;
width: 100%;
JoelLisenby /
Last active Sep 6, 2019
ffmpeg video encoding for web (chrome, firefox, safari, etc)
# h265
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p output.mp4
# h265 with colorspace specified
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 output.mp4
# h265 with colorspace specified and no audio
ffmpeg -i input.mp4 -c:v libx265 -vf scale=1280:720 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -an output.mp4
# webm