Skip to content

Instantly share code, notes, and snippets.

View sabrysuleiman's full-sized avatar

Sabry Suleiman sabrysuleiman

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 / 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 / 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 / top 100+ social bookmarking sites list.md
Created August 20, 2022 17:13 — forked from stackblogger/top 100+ social bookmarking sites list.md
DoFollow Backlink Sites | High PR Free Backlink Sites

TOP 100+ Social Bookmarking Sites List

DoFollow Backlink Sites | High PR Free Backlink Sites

Detailed article is shared here- TOP 100+ Social Bookmarking Sites List

A backlink is a type of link pointing out from a website to your website. It is also called inbound or incoming backlinks. Backlinks are used to generate traffic to your website. Search engines continuously crawls the web pages and if they find a link to your website at some page then they crawl your page too. So it increases the search engine visibility in the back end. Get top 100+ DoFollow High PR Backlink Sites list.

There are plenty of backlink websites available for free. But not all websites provide high quality free backlinks. This article will provide you high quality Free Backlink sites list.

@sabrysuleiman
sabrysuleiman / wp_autocomplete_search.js
Last active November 14, 2021 15:06 — forked from jaredatch/functions.php
WordPress Search Autocomplete using admin-ajax.php
/* globals global */
jQuery(function($){
var searchRequest;
$('.search-autocomplete').autoComplete({
minChars: 2,
source: function(term, suggest){
try { searchRequest.abort(); } catch(e){}
searchRequest = $.post(global.ajax, { search: term, action: 'search_site' }, function(res) {
suggest(res.data);
});
@sabrysuleiman
sabrysuleiman / Create page on theme activation
Created September 18, 2021 19:07 — forked from MartinL83/Create page on theme activation
Wordpress - Create page on theme activation
if (isset($_GET['activated']) && is_admin()){
$new_page_title = 'This is the page title';
$new_page_content = 'This is the page content';
$new_page_template = ''; //ex. template-custom.php. Leave blank if you don't want a custom page template.
$page_check = get_page_by_title($new_page_title);
$new_page = array(
'post_type' => 'page',
'post_title' => $new_page_title,
'post_content' => $new_page_content,
'post_status' => 'publish',
@sabrysuleiman
sabrysuleiman / post-process.php
Created September 17, 2021 19:31 — forked from duongns/post-process.php
WordPress Custom Post Type: Insert post via Frontend
<?php
/**
* post-process.php
* make sure to include post-process.php in your functions.php. Use this in functions.php:
*
* get_template_part('post-process');
*
*/
function do_insert() {
if( 'POST' == $_SERVER['REQUEST_METHOD']
@sabrysuleiman
sabrysuleiman / wp_insert_post_front_end_form.php
Created September 17, 2021 19:31 — forked from robhadfield/wp_insert_post_front_end_form.php
This is a sample front-end form using wp_insert_post(). It's quickly stripped out of my production code from Android and Me, and hasn't been tested alone, so please take it with a grain of salt.
<?
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted
$title = $_POST['thread_title']; //set our title
if ($_POST['thread_description']=="") { // check if a description was entered
$description = "See thread title..."; // if not, use placeholder
} else {
$description = $_POST['thread_description']; //if so, use it
@sabrysuleiman
sabrysuleiman / travel-agency-schema.html
Created July 26, 2021 11:05 — forked from pixelpylon/travel-agency-schema.html
microdata schema for travel agency
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "TravelAgency",
"name": "FreeTours",
"address": {
"@type": "PostalAddress",
"streetAddress": "",
"addressLocality": "New York",
"addressRegion": "NY",
@sabrysuleiman
sabrysuleiman / awesome-php.md
Created May 13, 2021 08:19 — forked from llbbl/awesome-php.md
Awesome PHP Libraries and Resources

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Micro Frameworks