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
{ | |
"general": { | |
"generalConditions": "General conditions", | |
"basicSettings": "Basic settings", | |
"contactUs": "Contact us", | |
"systemInfo": "System info", | |
"debugMode": "Debug mode", | |
"help": "Help", | |
"downloadSystemInfoFile": "Download system info file", | |
"curlIsNotInstalled": "cURL is not installed or enabled in your PHP installation. This is required for background task to work. Please install it and then refresh this page.", |
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
curl --request PURGE --output /dev/null --insecure --location --write-out '%{http_code}' --url https://website.de/* --silent | |
curl -X PURGE -o /dev/null -i -L -w "%{response_code}" --url https://website.es/* |
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 | |
function generate_password($length = 16, $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'){ | |
$str = ''; | |
$max = mb_strlen($characters, '8bit') - 1; | |
for ($i = 0; $i < $length; ++$i) { | |
$str .= $characters[random_int(0, $max)]; | |
} | |
return $str; | |
} | |
echo generate_password(16, '*&^%$#@!0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
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 | |
if (isset($_POST['input'])) { | |
$input = $_POST['input']; | |
$url = 'https://www.toptal.com/developers/javascript-minifier/api/raw'; | |
// init the request, set various options, and send it | |
$ch = curl_init(); | |
curl_setopt_array($ch, [ | |
CURLOPT_URL => $url, |
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 // Ignore this first line when copying to your child theme's functions.php file. | |
add_action( 'wp_footer', function () { ?> | |
<script> | |
(function () { | |
function testRestApi(url, cb) { | |
jQuery.ajax({ | |
url: url, | |
dataType: "text", | |
type: "GET", |
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/php | |
<?php | |
// 1. install https://github.com/stil/curl-easy | |
// | |
// composer require stil/curl-easy | |
// | |
// 2. fill a text file 'queries.txt' with queries, e.g. | |
// Berlin | |
// Madrid |
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
function Loader(el) { | |
el.loader = this; | |
this.el = el; | |
this.style = document.getElementById('js-loader-styles'); | |
this.init(); | |
if (!document.body.animate) { | |
if (!this.style) { | |
this.style = document.createElement('style'); |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# add a trailing slash to /wp-admin | |
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f [OR] |
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
# Google Analytics & Campaign Monitor | |
# Removes all query params where the key begins with "utm_" | |
# Skip the rewrites if no "utm_*" key exist. | |
RewriteCond %{QUERY_STRING} !(^|&)utm_ [NC] | |
RewriteRule .* - [S=3] | |
# Check and handle first query param. | |
RewriteCond %{QUERY_STRING} ^utm_[A-Za-z0-9]+=[^&]+(.*) [NC] | |
RewriteRule (.*) /$1?%1 [R=301,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
# Select all posts which are duplicates of a language. | |
# The language parameter is to only select by the new language (not the original duplication language). | |
SET @lang_code = 'da'; | |
SELECT pm.*, p.post_title, p.post_type, icl.language_code | |
FROM wp_postmeta pm | |
INNER JOIN wp_icl_translations icl ON icl.element_id = pm.post_id | |
INNER JOIN wp_posts p ON p.`ID` = pm.post_id | |
WHERE meta_key='_icl_lang_duplicate_of' AND icl.language_code = @lang_code; |
NewerOlder