Skip to content

Instantly share code, notes, and snippets.

View Vitzkrieg's full-sized avatar

Dustin Vietzke Vitzkrieg

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Vitzkrieg
Vitzkrieg / .cpanel.yml
Created November 20, 2025 15:51
.cpanel.yml deploy Git branch based on package.json
---
deployment:
tasks:
- export REPONAME=<repo-name> # folder name of Git repo on server
- export THEMENAME=<theme-name> # folder name of WP theme
- export BACKUPPATH=<path-to-cpanel-bkp>/<theme-name>_$(date +%Y%m%d_%H%M%S) # backup folder with date_time
- export DEPLOYPATH=/home/<account-name>/public_html/wp-content/themes/ # theme folder will be in /dist/
- export PATH=~/.nvm/versions/node/v24.11.0/bin:$PATH # make sure npm path is set
- mkdir -p $BACKUPPATH # create backup folder
- cd /home/ostkznpw/repos/$REPONAME # move into repo folder
@Vitzkrieg
Vitzkrieg / pe-customize-controls.css
Created July 9, 2025 11:22 — forked from OriginalEXE/pe-customize-controls.css
Extending WordPress Customizer Panels and Sections to allow nesting
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
#customize-theme-controls .customize-pane-child.current-section-parent {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}
@Vitzkrieg
Vitzkrieg / gist:b008f34ef86d946848869c3a316b429b
Created October 30, 2023 17:51
Get Element's Before Content
const el = document.getElementById('id');
const beforeText = getComputedStyle(el, ':before').getPropertyValue('content');
@Vitzkrieg
Vitzkrieg / wp-option-name-to-title-case.php
Last active October 10, 2023 11:51
WordPress Option Name to Title Case
// convert wp_option_name -> Wp Option Name
$titlecase = ucwords( implode(' ', explode('_', $option->option_name) ) );
@Vitzkrieg
Vitzkrieg / WP-HTML-Compression
Last active September 5, 2023 14:19 — forked from sethbergman/WP-HTML-Compression
Minify HTML for WordPress without a Plugin - Add to function.php
<?php
/**
* Class to minify HTML
*
* @link https://gist.github.com/sethbergman/d07e879200bef6862131
*/
class WP_HTML_Compression
{
// Settings
<?php
add_action('get_header', 'pt_html_minify_start');
function pt_html_minify_start() {
ob_start( 'pt_html_minyfy_finish' );
}
function pt_html_minyfy_finish( $html ) {
$html = preg_replace('/<!--(?!s*(?:[if [^]]+]|!|>))(?:(?!-->).)*-->/s', '', $html);
$html = preg_replace('/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/m', "$1", $html);
$html = preg_replace('/^\/\/[^\n\r]+(?:[\n\r]|\*\))$/m', "$1", $html);