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
... | |
echo "Ready to deploy to Pantheon" | |
if [[ $CI_BRANCH != $DEFAULT_BRANCH ]] | |
then | |
echo "Pushing to a multidev environment." | |
ENV_EXISTS=$(terminus env:list "$TERMINUS_SITE" --field=id | grep "^$TERMINUS_ENV$" || true) | |
if [[ $ENV_EXISTS ]] |
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 | |
/** | |
* ACF object caching | |
* | |
* Adds Object caching support to ACF so taht it doesn't have to recalculate all of | |
* its data on each page load. It can substantially improve performance on sites that | |
* heavily use ACF. | |
* | |
* This is NOT multisite compatible. ACF uses an alternative data structure for multisites. | |
* Its internal APIs don't support an external tool to cache all of the multisite data. |
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
find /path/to/starting/directory -mindepth 1 -type d -exec bash -c 'echo -n "{}: "; find "{}" -maxdepth 1 -type f | wc -l' \; |
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
<fieldType name="text" class="solr.TextField" positionIncrementGap="100"> | |
<analyzer type="index"> | |
<tokenizer class="solr.WhitespaceTokenizerFactory"/> | |
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/> | |
<filter class="solr.LowerCaseFilterFactory"/> | |
<!-- filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/ --> | |
<filter class="solr.SnowballPorterFilterFactory" protected="protwords.txt" language="English"/> | |
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/> | |
<filter class="solr.GermanNormalizationFilterFactory"/> | |
</analyzer> |
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 | |
/** | |
* Helper function to remove a directory and all its contents. | |
* PHP requires you to remove each file individually and delete | |
* a directory only when it's empty. | |
* | |
* @param string $path Absolute path to a directory. | |
*/ | |
function remove_directory( $path ) { | |
$files = glob( $path . '/*' ); |
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 | |
/** | |
* Sunrise - load very early. | |
*/ | |
/** | |
* If the request is for a file, send it to the legacy ms-files.php for processing. | |
* | |
* File requests follow the pattern `multisite.com/sitename/files/2022/06/filename.jpg` | |
*/ |
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 | |
// Instance of the batch processing job. | |
$job = MyBatchJob(); | |
// How many failed attempts do you want to process. | |
$batch_max_attempts = 3; | |
add_action( 'action_scheduler_failed_execution', 'maybe_retry_failed_batch' ); | |
add_action( 'action_scheduler_failed_action', 'maybe_retry_failed_batch' ); |
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
"use strict"; | |
"undefined" == typeof window.console && (window.console = { log: function () {}, debug: function () {} }); | |
"undefined" == typeof JSON && (JSON = { stringify: function () {}, parse: function () {} }); | |
Array.prototype.indexOf || | |
(Array.prototype.indexOf = function (e) { | |
var t = this.length >>> 0, | |
n = Number(arguments[1]) || 0; | |
n = 0 > n ? Math.ceil(n) : Math.floor(n); | |
0 > n && (n += t); | |
for (; t > n; n++) if (n in this && this[n] === e) return n; |
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
add_header Set-Cookie "my_test_group=$test_group;Domain=.mydomain.com;Path=/;Max-Age=604800"; |
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
<div class="tiles tiles--two-per-row"> | |
<div class="tile"> | |
<div class="tile__photo"> | |
<img src="https://picsum.photos/id/344/1440/900" class="tile__photo__image"> | |
</div> | |
<h3 class="tile__title tile_title--small">Beef enim hamburger, doner</h3> | |
<p class="tile__description"> | |
salami cupidatat ipsum deserunt. Corned beef prosciutto esse eiusmod short loin sausage ut jowl ipsum | |
cupidatat. Flank meatball pariatur fugiat meatloaf beef. Pork chop turkey jerky, in nostrud in non | |
consectetur turducken shoulder pig esse cow eu. |
NewerOlder