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
<script> | |
function loadScript(url) { | |
let isLoaded = document.querySelectorAll('.search-script'); | |
if(isLoaded.length > 0) { return; } | |
let myScript = document.createElement("script"); | |
myScript.src = url; | |
myScript.async = 'async'; | |
myScript.className = 'search-script'; | |
document.head.appendChild(myScript); | |
} |
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 add_lazy_loading_to_images($content) { | |
// Add loading="lazy" to all <img> tags in the content | |
$content = preg_replace('/<img(.*?)src=(["\'])(.*?)\2(.*?)>/i', '<img$1loading="lazy" src=$2$3$2$4>', $content); | |
return $content; | |
} | |
add_filter('the_content', 'add_lazy_loading_to_images'); |
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
<IfModule mod_expires.c> | |
ExpiresActive On | |
# Images | |
ExpiresByType image/jpeg "access plus 1 year" | |
ExpiresByType image/gif "access plus 1 year" | |
ExpiresByType image/png "access plus 1 year" | |
ExpiresByType image/webp "access plus 1 year" | |
ExpiresByType image/avif "access plus 1 year" | |
ExpiresByType image/avif-sequence "access plus 1 year" |
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
# Install Node.js and npm | |
sudo apt update | |
sudo apt install nodejs | |
sudo apt install npm | |
# Install Cordova | |
sudo npm install -g cordova | |
# Create a Cordova Project | |
cordova create MyAndroidApp |
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
export APACHE_RUN_USER=username | |
export APACHE_RUN_GROUP=www-data | |
sudo adduser username www-data |
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
# Set Up Apache Virtual Hosts on Ubuntu | |
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/domain.conf | |
sudo nano /etc/apache2/sites-available/domain.conf | |
ServerAdmin webmaster@localhost | |
ServerName your_domain_1 | |
ServerAlias www.your_domain_1 | |
DocumentRoot /var/www/html | |
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
To create an enhanced data layer for your WordPress website, you can follow these steps: | |
Install and activate a Google Tag Manager (GTM) plugin: | |
First, you need to install a GTM plugin to your WordPress site. A popular choice is the Google Tag Manager for WordPress by Thomas Geiger. You can install and activate it from your WordPress dashboard by going to Plugins > Add New and searching for "Google Tag Manager for WordPress". | |
Set up a Google Tag Manager account: | |
If you don't already have a GTM account, sign up and create a new container for your website. | |
Configure the GTM plugin: | |
In your WordPress dashboard, go to Settings > Google Tag Manager and enter your GTM container ID (e.g., GTM-XXXXXX). Follow the plugin's instructions to properly configure the settings. |
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 | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* | |
* Replace Disallow with Allow Generated Robots.txt | |
* Credit: Unknown | |
* Last Tested: June 09 2020 using WordPress 5.4.1 | |
*/ | |
add_filter('robots_txt','custom_robots'); |
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
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Alt>Shift_R']" | |
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['<Alt>Shift_L']" |
NewerOlder