Skip to content

Instantly share code, notes, and snippets.

View mrtechnique's full-sized avatar

Tom Nguyen mrtechnique

View GitHub Profile
<strong>({Payment Amount:5} + .3) / (1 - .029)</strong>
@mrtechnique
mrtechnique / gist:3a5284330720ae1ee475c9c712bde7fe
Created November 15, 2017 23:11
Remove CSS and JS Versioning in WordPress
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
@mrtechnique
mrtechnique / gist:5be7ee5cf3ca4602a2546ee73f49566e
Created May 22, 2018 02:47
Alfred Chrome Incognito Workflow
tell application "System Events"
set myList to (name of every process)
end tell
if (myList contains "Google Chrome") is false then
do shell script "open -a Google\\ Chrome --new --args -incognito"
else
tell application "Google Chrome"
activate
tell application "System Events" to keystroke "n" using {command down, shift down}
open location "https://google.com/search?q=keyword+number+1"
@mrtechnique
mrtechnique / url-parameters-to-wordpress-shortcodes.txt
Last active July 11, 2018 01:36
Generating WordPress Shortcodes from URL Parameters
//1. CAPTURE FIRST NAME FROM URL
function aa_first_name() {
$aa_first_name = $_GET["fname"];
if (isset($aa_first_name)) {
$aa_first_name = ucfirst($aa_first_name);
return $aa_first_name;
} else {
return '';
}
}
@mrtechnique
mrtechnique / gist:5f377bd3a5c794dda434cd2ed693f09a
Last active July 24, 2018 14:36
WordPress code needed in wp-config.php to display errors
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );