Skip to content

Instantly share code, notes, and snippets.

@HDDen
HDDen / cf_cache_rules_implementation_guide_spcc.md
Created January 23, 2024 12:46 — forked from isaumya/cf_cache_rules_implementation_guide_spcc.md
Super Page Cache for Cloudflare — Guide for using Remove Cache Buster Query Parameter feature (when using Cache Everything page rule)

Implementation Guide for using "Remove Cache Buster Query Parameter" feature

The Super Page Cache for Cloudflare plugin has recently added the feature for using the Cache Everything pagerule withing the ?swcfpc=1 cache buster query paramater. This opens up so many new doors where users previously had to use the Cloudflare Workers to remove the cache buster.

With this new option now users are able to take advantage of Cloudflare Cache Everything page rule and take it to the next level by using the new Rulesets released by Cloudflare. Basically this is achived by taking advantage of the all new Cache Rules feature implemented by Cloudflare.


Setp 1 — Setting up the Cache Rules inside your Cloudflare Dashboard

The first thing that you need to do is, log-in to your Cloudflare Dahsbord and go to the domain/zone doe which you are setting up the [Super Page Cache for Cloudflare](https://wordpress.org/plug

@HDDen
HDDen / gist:1938139b791b66541a42db642d265d9f
Created July 13, 2023 06:10 — forked from nkarpeev/gist:5fb28d13e0aa02494d1464ecea374fd1
Using the_posts_pagination for custom page template WordPress
// Define page_id
$page_ID = get_the_ID();
// Define paginated posts
$page = get_query_var( 'page' );
// Define custom query parameters
$args = array(
'post_type' => array( 'post', 'book', 'movie' ), // post types
'posts_per_page' => 5,
@HDDen
HDDen / JSON_to_URLEncoded.js
Last active July 11, 2023 14:30 — forked from lastguest/JSON_to_URLEncoded.js
Convert JavaScript object to x-www-form-urlencoded format
if (!window['hdden_JSON_to_URLEncoded']) {
window['hdden_JSON_to_URLEncoded'] = hdden_JSON_to_URLEncoded;
}
function hdden_JSON_to_URLEncoded(element, key, list) {
var list = list || [];
if (typeof (element) == 'object') {
for (var idx in element)
hdden_JSON_to_URLEncoded(element[idx], key ? key + '[' + idx + ']' : idx, list);
} else {
list.push(key + '=' + encodeURIComponent(element));
@HDDen
HDDen / _README.md
Created February 6, 2023 07:20 — forked from lord-alfred/_README.md
Y-Factors Formula

Y-Factors Formula

Здесь опубликованы коэффициенты для одного из внутренних ранжировщиков в поиске Яндекса. Это не итоговая формула, которая влияет на результат появления ссылки в серпе, т.к. судя по изученному коду – внутри используется несколько ранжировщиков и поисковых движков, результаты которых мержатся между собой и уже итоговый результат приводит к распределению ссылок по топу выдачи.

коэффициенты влияния на факторы

| Коэффициент | Название Фактора | Описание Фактора |

@HDDen
HDDen / wp.sql
Last active August 8, 2022 07:49 — forked from esedic/wp.sql
SQL queries for moving WordPress website to a new domain
UPDATE wp_options SET option_value = REPLACE(option_value, 'https://dev.mysite.com', 'https://mysite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = REPLACE (post_content, 'https://dev.mysite.com', 'https://mysite.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'https://dev.mysite.com','https://mysite.com');
UPDATE wp_comments SET comment_content = REPLACE (comment_content, 'https://dev.mysite.com', 'https://mysite.com');
UPDATE wp_comments SET comment_author_url = REPLACE (comment_author_url, 'https://dev.mysite.com','https://mysite.com');
UPDATE wp_posts SET guid = REPLACE (guid, 'https://dev.mysite.com', 'https://mysite.com') WHERE post_type = 'attachment';
-- мультисайт
UPDATE wp_blogs SET domain = REPLACE (domain, 'dev.mysite.com', 'mysite.com');
UPDATE wp_site SET domain = REPLACE (domain, 'dev.mysite.com', 'mysite.com');
@HDDen
HDDen / OutputmodMinify.php
Last active January 18, 2024 15:41 — forked from Rodrigo54/php-html-css-js-minifier.php
PHP class to Minify HTML, CSS and JavaScript
<?php
/**
* Class OutputmodMinify
*
* include_once 'OutputmodMinify.php';
* $html = \OutputmodMinify::minify($html);
*/
/**
* -----------------------------------------------------------------------------------------