Merge files
Cd folder with all files
cat *.csv >combined.csv
Shuffle lines
perl -MList::Util=shuffle -e 'print shuffle();' < myfile > target_file
| <?php | |
| namespace x\minify\_ { // start namespace | |
| $n = __NAMESPACE__; | |
| \define($n . "\\token_boolean", '\b(?:true|false)\b'); | |
| \define($n . "\\token_number", '-?(?:(?:\d+)?\.)?\d+'); | |
| \define($n . "\\token_string", '(?:"(?:[^"\\\]|\\\.)*"|\'(?:[^\'\\\]|\\\.)*\')'); |
Merge files
Cd folder with all files
cat *.csv >combined.csv
Shuffle lines
perl -MList::Util=shuffle -e 'print shuffle();' < myfile > target_file
Basic text classification with elasticsearch need language analyzer Source: https://www.elastic.co/blog/text-classification-made-easy-with-elasticsearch
| <?php | |
| add_filter('language_attributes', function($language_attributes) { | |
| $la = explode('-',$language_attributes); | |
| if(!$la){ | |
| return $language_attributes; | |
| } | |
| return $la[0].'"'; | |
| } ) ; |
| 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
| <?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'); |
| <?php | |
| $rr = $_SERVER['REQUEST_URI']; | |
| $dt = strtoupper(str_replace(['.html','.php','/'],['','',''],$rr))." | OriginalTitle"; |
| RemoveHandler .php .phtml .php3 | |
| RemoveType .php .phtml .php3 | |
| php_flag engine off |
| <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 { |