This file contains hidden or 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
| # Optimized my.cnf configuration for MySQL/MariaSQL | |
| # | |
| # by Fotis Evangelou, developer of Engintron (engintron.com) | |
| # | |
| # ~ Updated January 2020 ~ | |
| # | |
| # | |
| # The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores. | |
| # If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
| # |
This file contains hidden or 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
| // This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.github.io | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
| */ |
This file contains hidden or 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
| function custom_query_shortcode($atts) { | |
| // EXAMPLE USAGE: | |
| // [loop the_query="showposts=100&post_type=page&post_parent=453"] | |
| // Defaults | |
| extract(shortcode_atts(array( | |
| "the_query" => '' | |
| ), $atts)); |
This file contains hidden or 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
| Regular expression cheat sheet for Varnish | |
| Varnish regular expressions are NOT case sensitive. Varnish uses POSIX | |
| regular expressions, for a complete guide, see: "man 7 regex" | |
| Basic matching: | |
| req.url ~ "searchterm" | |
| True if req.url contains "searchterm" anywhere. | |
| req.url == "searchterm" |
This file contains hidden or 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 | |
| /** | |
| * ajax-handler.php | |
| * | |
| * This mu-plugin is loaded before any other plugin code. | |
| * It attempts to recognize some API-ish calls (i.e. | |
| * traditional admin-ajax.php, wc-ajax and hopefully some | |
| * wp-json/wp-api things at a later stadium. | |
| * |
This file contains hidden or 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
| /* SET THE HOST AND PORT OF WooCommerce | |
| * *********************************************************/ | |
| backend default { | |
| .host = "127.0.0.1"; | |
| .port = "8080"; | |
| } | |
| # SET THE ALLOWED IP OF PURGE REQUESTS | |
| # ########################################################## |
This file contains hidden or 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
| # Varnish 4 VCL for Wordpress | |
| # - https | |
| # - admin cookies for wp-admin | |
| # - cache everything | |
| # - custom error html page | |
| # - TODO: Add WooCommerce support | |
| vcl 4.0; | |
| import directors; | |
| import std; |