Run container:
docker run --rm -it \
  --cap-add SYS_ADMIN \
  --device /dev/fuse \
  --security-opt apparmor=unconfined \
  -v ~/Downloads/images:/images \
  ubuntu:24.04 bashRun container:
docker run --rm -it \
  --cap-add SYS_ADMIN \
  --device /dev/fuse \
  --security-opt apparmor=unconfined \
  -v ~/Downloads/images:/images \
  ubuntu:24.04 bash| ## get file from production if doesn't exist on dev environment | |
| RewriteCond %{HTTP_HOST} =site1.xyz | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_URI} .(gif|jpe?g|png|bmp|tiff|xcf|psd|ico|svg|pdf|mp4)$ [NC] | |
| RewriteRule ^(.*)$ https://www.productionsite.com/$1?from=dev [R=301,L] | 
| <?php | |
| function interceptQuery( $query ) { | |
| if ( $GLOBALS['pagenow'] === 'users.php' && strpos( $query, 'SELECT post_author, COUNT(*) FROM' ) === 0 ) { | |
| echo '<h3>count_many_users_posts disabled for performance reasons</h3>'; | |
| return false; | |
| } | |
| return $query; | |
| } | 
| <?php | |
| /* | |
| WPML checks for gutenberg like this: | |
| \WPML_Page_Builders_Defined->has() | |
| ``` | |
| if ( 'gutenberg' === $page_builder ) { | |
| if ( version_compare( $wp_version, '5.0-beta1', '>=' ) ) { | |
| return true; | |
| } | |
| } | 
| <noscript id="deferred-styles"> | |
| <link rel="stylesheet" href="/assets/styles/slick/slick-all.min.css" type="text/css" media="all" /> | |
| <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap&subset=cyrillic,cyrillic-ext,latin-ext" rel="stylesheet"> | |
| </noscript> | |
| <script> | |
| var loadDeferredStyles = function() { | |
| var addStylesNode = document.getElementById("deferred-styles"); | |
| var replacement = document.createElement("div"); | |
| replacement.innerHTML = addStylesNode.textContent; | |
| document.body.appendChild(replacement) | 
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| (function() { | |
| var throttle = function(type, name, obj) { | |
| obj = obj || window; | |
| var running = false; | |
| var func = function() { | |
| if (running) { return; } | |
| running = true; | |
| requestAnimationFrame(function() { | |
| obj.dispatchEvent(new CustomEvent(name)); | |
| running = false; | 
| ; -------------------------------------------------------------- | |
| ; Switches the left Control and Alt keys. | |
| ; -------------------------------------------------------------- | |
| ;LCtrl::LAlt | |
| ;LAlt::LCtrl | |
| ;Apple keyboard | |
| ;LAlt::LWin | |
| ;LWin::LAlt | 
| <?php | |
| $start = microtime(true); | |
| $cycles = 0; | |
| $elapsed = 0; | |
| do { | |
| $loops = 1000; | |
| $begin = microtime(true); | |
| do { | |
| // Тестируемая операция | 
| /* | |
| No jQuery necessary. | |
| Thanks to Dan's StackOverflow answer for this: | |
| http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport | |
| */ | |
| function isOneHundredPercentOfElementInViewport(el) { | |
| var rect = el.getBoundingClientRect(); | |
| return ( | |
| rect.top >= 0 && |