Skip to content

Instantly share code, notes, and snippets.

View sabrysuleiman's full-sized avatar
🏠
Working from home

Sabry Suleiman sabrysuleiman

🏠
Working from home
View GitHub Profile
@sabrysuleiman
sabrysuleiman / .htaccess
Created November 18, 2023 18:23 — forked from lukecav/.htaccess
Browser caching for Apache
<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"
@sabrysuleiman
sabrysuleiman / gist:227141bc5fe3f19dab73d5374f4ec8e4
Created November 15, 2023 17:52
Installing Apache Cordova on Ubuntu
# 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
@sabrysuleiman
sabrysuleiman / make Apache run as current user
Created June 30, 2023 18:49
make Apache run as current user
export APACHE_RUN_USER=username
export APACHE_RUN_GROUP=www-data
sudo adduser username www-data
@sabrysuleiman
sabrysuleiman / Set Up Apache Virtual Hosts on Ubuntu
Last active February 13, 2025 06:32
Set Up Apache Virtual Hosts on Ubuntu
# 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
@sabrysuleiman
sabrysuleiman / enhanced data layer for your WordPress website
Created April 13, 2023 20:51
enhanced data layer for your WordPress website
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.
@sabrysuleiman
sabrysuleiman / wordpress_robots_custom.php
Created April 6, 2023 22:51 — forked from amboutwe/wordpress_robots_custom.php
Filters and example code for Yoast SEO robots or WP robots.txt
<?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');
@sabrysuleiman
sabrysuleiman / Switching language shortcut (Alt + Shift) in ubuntu
Created March 31, 2023 22:09
Switching language shortcut (Alt + Shift) in ubuntu
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']"
@sabrysuleiman
sabrysuleiman / social sharing URLs
Last active April 18, 2024 12:59 — forked from csknk/social sharing URLs
Social Share URLs
https://twitter.com/intent/tweet?text={$encodedText}&url={$encodedUrl}
http://pinterest.com/pin/create/bookmarklet/?media=[MEDIA]&url=[URL]&is_video=false&description=[TITLE]
http://www.facebook.com/share.php?u=[URL]&title=[TITLE]
http://www.reddit.com/submit?url=[URL]&title=[TITLE]
http://del.icio.us/post?url=[URL]&title=[TITLE]]&notes=[DESCRIPTION]
@sabrysuleiman
sabrysuleiman / How to Enable or Disable php mod_* in Apache Ubuntu
Last active January 21, 2023 14:48
How to Enable/Disable php mod_* in Apache Ubuntu
# If you want to install Apache module such as mod_headers, you need to issue the a2enmod command
sudo a2enmod <module_name>
# Like
sudo a2enmod headers
sudo a2enmod rewrite
sudo a2enmod alias
# Restart Apache Web Server
sudo service apache2 restart
@sabrysuleiman
sabrysuleiman / Remove slug from custom post type post URLs
Created December 24, 2022 14:24
Remove slug from custom post type post URLs
'rewrite' => [
'slug' => '/',
'with_front' => false
]