This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# PHP Syntax linter, checks syntax before commit actually happens | |
# Save this file in your git project as .git/hooks/pre-commit and make sure it's executable | |
# PHP lint command, modify if necessary | |
LINT='/usr/bin/php -l' | |
files=$(git diff --cached --name-only --diff-filter=ACM | grep "\.php$") | |
if [ "$files" = "" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Scroll into Custom Fields settings | |
document.querySelector(".wpml-custom-fields-settings").scrollIntoView(); | |
// Click on 'Display All' button | |
jQuery(".wpml-custom-fields-settings .display-all").click(); | |
const set_acf_fields_translatable = setInterval(() => { | |
// When 'Display All' button is clicked, the 'display-all' class is removed, therefore check until it doesnt exist | |
if (jQuery(".wpml-custom-fields-settings .display-all").length == "0") { | |
// Scroll into the 'Save' button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global jQuery, iziToast */ | |
// Chained select (listbox) on tinymce window (modal) | |
tinymce.PluginManager.add('address_shortcode_inserter', function (editor) { | |
var addresses = []; | |
function getCountries(countryID, elm) { | |
let win = tinymce.activeEditor.windowManager.getWindows()[0]; | |
let countriesField = win.find(`#${elm.name}`); | |
let citiesField = win.find(`#${fields.citiesField.name}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
error_log stderr warn; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Vary LCP Image Optimizations WordPress Plugin. | |
* | |
* @package VaryLcpImageOptimizations | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2023 Google Inc. | |
* | |
* @wordpress-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Flush the object cache using this WP-CLI command. | |
wp cache flush | |
#Beaver Builder plugin and Beaver Theme have these WP-CLI commands. | |
wp beaver clearcache | |
wp beaver theme clearcache | |
wp beaver clearcache --all | |
#Autoptimize plugin has this WP-CLI command. | |
wp autoptimize clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Insert the following line in the client's config.ovpn file: | |
tls-cipher "DEFAULT:@SECLEVEL=0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Clear Total Cache term listing pages for a post | |
* @param $post_id | |
* @param $post | |
* | |
* @return void | |
*/ | |
function rw_clear_total_cache_terms_pages( $post_id, $post ) { | |
if ( function_exists( 'w3tc_flush_url' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://gist.github.com/mrienstra/8330528 | |
-- Based on http://www.tuaw.com/2012/12/24/applescript-desktop-icon-race/ | |
-- Inspired by http://namesakecomic.com/comic/happy-new-year-from-namesake/#comment-1182035013 | |
-- Rearranges Desktop icons to flow from left to right, top to bottom. | |
-- To have this run automatically every time files are added or removed from the Desktop, set this script to run as a Desktop "Folder Action". (See https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/ASLR_folder_actions.html ) | |
-- This is currently a rough proof-of-concept. It has only been tested with OS y 10.8.5 (Mountain Lion). |
NewerOlder