Skip to content

Instantly share code, notes, and snippets.

View codepuncher's full-sized avatar
🙃
i do a code (or two)

Lee Hanbury codepuncher

🙃
i do a code (or two)
View GitHub Profile
@codepuncher
codepuncher / bb-row-advanced-bg-class-field.php
Created April 1, 2021 10:35
Add a "Background Class" select field to Beaver Builder row "Advanced" tab.
<?php
/**
* Add a "Background Class" setting to the row, advanced, CSS selectors section.
*/
add_filter('fl_builder_register_settings_form', function (array $form, string $id): array {
if ('row' !== $id) {
return $form;
}
@codepuncher
codepuncher / fix_post_urls.sh
Last active March 26, 2021 15:07
WordPress Multisite (per-site) - Fix missing/invalid Post Permastructs, add redirects and validate them.
#!/usr/bin/env bash
# set -x # debug mode - shows all command output
# Get the full path to the wp program.
wp=$(which wp)
# Get the full path to the curl program
curl=$(which curl)
@codepuncher
codepuncher / quickwin.sh
Created July 19, 2017 11:55
Quickwin - Focus active window or open program
#!/usr/bin/env bash
# Focus window from 1st argument or
# executes command from 2nd argument
wmctrl -ia $(wmctrl -l | grep -i ${1} | awk '{print $1}') || ${2} &