Basic text classification with elasticsearch need language analyzer Source: https://www.elastic.co/blog/text-classification-made-easy-with-elasticsearch
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_filter('language_attributes', function($language_attributes) { | |
$la = explode('-',$language_attributes); | |
if(!$la){ | |
return $language_attributes; | |
} | |
return $la[0].'"'; | |
} ) ; |
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
zip ./public_html/fb.zip ./public_html -r -x '*.html' -x '*.cache' -x '*.jpg' -x '*uploads/*' -x '*.log' -x '*.xml' -x '*.zip' -x '*.gz' |
Prevent yoast high mysql load on huge websites
run this command every 12 hours
/usr/bin/php "/home/user/public_html/wp-truncate-indexables.php" > /dev/null 2>&1
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_user_abort( true ); | |
define( 'WP_USE_THEMES', false ); | |
define( 'DONOTCACHEPAGE', true ); | |
require( dirname( __FILE__ ) . '/wp-blog-header.php' ); | |
ini_set('memory_limit','6G'); | |
$sitemapIndex = home_url('sitemap_index.xml'); |
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 | |
$rr = $_SERVER['REQUEST_URI']; | |
$dt = strtoupper(str_replace(['.html','.php','/'],['','',''],$rr))." | OriginalTitle"; |
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
RemoveHandler .php .phtml .php3 | |
RemoveType .php .phtml .php3 | |
php_flag engine off |
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
<style> | |
*, ::after, ::before { | |
box-sizing: border-box; | |
} | |
.collapse { | |
display: block; | |
max-height: 0px; | |
overflow: hidden; | |
transition: max-height .5s cubic-bezier(0, 1, 0, 1); | |
&.show { |
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
RewriteEngine on | |
RewriteBase "/" | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)\.html$ $1.php?%{QUERY_STRING} [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^.*$ index.php [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
find . -type d -exec chmod 755 {} \; | |
find . -type f -exec chmod 644 {} \; |