View Install.txt
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
1) Install cloudflared using homebrew: | |
brew install cloudflare/cloudflare/cloudflared | |
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content | |
proxy-dns: true | |
proxy-dns-upstream: | |
- https://1.1.1.1/dns-query | |
- https://1.0.0.1/dns-query |
View hardcode-number-of-items.php
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 | |
/** | |
* name | |
* | |
* @package Soderlind\MuPlugins\HardcodeNumberOfItems | |
* @author Per Soderlind | |
* @copyright 2021 Per Soderlind | |
* @license GPL-2.0+ | |
* |
View a_faster_load_textdomain.php
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 | |
/* | |
Plugin Name: A faster load_textdomain | |
Version: 0.0.1 | |
Description: While we're wating for https://core.trac.wordpress.org/ticket/32052. | |
Author: Per Soderlind | |
Author URI: https://soderlind.no | |
Plugin URI: https://gist.github.com/soderlind/610a9b24dbf95a678c3e | |
License: GPL |
View mb_similar_text.php
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 | |
/* | |
* solves the problem at http://stackoverflow.com/questions/31002690/how-to-use-similar-text-php-code-in-arabic, not that I know Arabic, but Norwegian also has multibyte charachters: æøåÆØÅ | |
*/ | |
//from http://www.phperz.com/article/14/1029/31806.html | |
function mb_split_str($str) { | |
preg_match_all("/./u", $str, $arr); | |
return $arr[0]; | |
} |
View plausible-2f-fix.php
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 | |
/** | |
* Plugin Name: Plausible 2f Fix | |
* Description: Fix for Plausible Analytics %2f removal from shard link. | |
* Plugin URI: https://gist.github.com/soderlind/6d6735baeab379b4d7e1e5497cd8581b | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt | |
*/ | |
declare( strict_types = 1 ); |
View class-google-maps-oembed-provider.php
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 | |
/** | |
* Create a Google Maps oEmbed Provider using the Google Maps Embed API | |
* | |
* @see https://developers.google.com/maps/documentation/embed/ | |
* @link https://gist.github.com/soderlind/db6dae8a73253329bc97ac50d7ebedef | |
* @since 1.0.0 | |
* @package Google_Maps_oEmbed_Provider | |
*/ | |
class DSS_oEmbed_Add_Provider { |
View server.conf
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
server { | |
# Add the following to your default server block: | |
rewrite /robots\.txt$ /index.php?robots=1 last; | |
} |
View dropzonejs-wp-rest-api.js
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
/* | |
Uploading images is a two step process (from https://github.com/WP-API/WP-API/issues/1768#issuecomment-160540932): | |
POST the data to /wp/v2/media - this can either be as the request body, or in multipart format. This will upload the file, and give you a 201 Created response with a Location header. This header points to the post object for the attachment that has just been created. | |
PUT the post data to the endpoint returned in the Location header (which will look something like /wp/v2/media/{id}). | |
I do step 2 (PUT), if POST is a success, in myDropzone.on("success", function(file, response){} | |
*/ | |
// dropzoneWordpressRestApiForm is the configuration for the element that has an id attribute |
View mu-example-rest-response.php
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 | |
add_action( 'muplugins_loaded',function() : void { | |
$my_rest_endpoint = '/wp-json/super-admin-all-sites-menu/v1/sites/'; | |
$request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ); | |
/** | |
* Bail if not the correct request. | |
*/ |
NewerOlder