Skip to content

Instantly share code, notes, and snippets.

View ihfbib's full-sized avatar
🎯
Focusing

Hamada Habib ihfbib

🎯
Focusing
View GitHub Profile
Bing Webmaster Tools
https://www.bing.com/toolbox/webmaster free
Browseo
http://www.browseo.net/ free
Google Analytics
https://www.google.com/analytics/ free
# SETUP #
DOMAIN=example.com
PROJECT_REPO="git@github.com:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@ihfbib
ihfbib / archive-org-m3u.py
Created August 15, 2024 21:29 — forked from thcipriani/archive-org-m3u.py
Create m3u files from Archive.org search results
#!/usr/bin/env python2
# coding: utf-8
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@ihfbib
ihfbib / service-workers.md
Created April 22, 2024 03:40 — forked from mmazzarolo/service-workers.md
Service Workers Tips

Service Workers Tips

Reloading a service worker

Reloading a page won't update/remove the previous version of its service worker. To make sure you're using the latest version of your service worker, make sure to check the "Update on reload" toggle in the "Application" ⭢ "Service Workers" section of the Chrome DevTools.

Simulate a network condition

To simulate a network condition (e.g.: offline, 3g, etc...) in a service worker on Chrome, uncheck the "Update on reload" toggle.

@ihfbib
ihfbib / facebook_crawler.sh
Created February 19, 2024 01:10 — forked from landsman/facebook_crawler.sh
Cloudflare IP address whitelist for Google Crawlers, Google Ads: https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot
#!/bin/bash
#
# see: https://developers.facebook.com/docs/sharing/webmasters/crawler/
#
# Run the whois command and store the output in a variable
whois_output=$(whois -h whois.radb.net -- '-i origin AS32934')
# Use grep to extract lines starting with "route"
@ihfbib
ihfbib / amazon-autocomplete
Created December 12, 2023 04:56 — forked from derekmartinla/amazon-autocomplete
Leverage Amazon To Find High Commercial Intent Keywords
/**********************************************************************************************************************
* Amazon Autocomplete Tool
* Leverage the Amazon Autocomplete feature to find highly commercial keyword opportunities.
* Export the results for efficient importing into Google Adwords
* Version 1.0
* Created By: Derek Martin
* DerekMartinLA.com or MixedMarketingArtist.com
**********************************************************************************************************************/
var hashMapResults = {};
@ihfbib
ihfbib / matty-double-post-type-rewrite-rule-example.php
Created October 16, 2023 06:49 — forked from mattyza/matty-double-post-type-rewrite-rule-example.php
A WordPress custom rewrite rule example, combining two post types.
<?php
/**
* Plugin Name: Double Post Type Rewrite Rule Example
* Plugin URI: https://gist.github.com/mattyza/7dfd156992f23835f68e
* Description: Adds a custom rewrite rule to mimic http://domain.com/post-type-01/post-type-02/.
* Author: Matty Cohen
* Author URI: http://matty.co.za/
* Version: 1.0.0
* Stable tag: 1.0.0
* License: GPL v3 - http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
@ihfbib
ihfbib / card.php
Created October 4, 2023 00:13 — forked from Niq1982/card.php
Load more to WordPress blog archive using AlpineJS and Axios
<div class="card">
<?php if ($args['link']) : ?>
<a href="<?php echo esc_url($args['link']); ?>" class="global-link">
</a>
<?php endif; ?>
<div class="card-image">
<?php wp_get_attachment_image($args['image']); ?>
</div>
@ihfbib
ihfbib / opcache-preload.php
Created September 6, 2023 11:32 — forked from fedek6/opcache-preload.php
Working WordPress opcache preloading config
<?php
/**
* WordPress opcache preloading.
* Requires PHP >= 7.4.
*
* @author Konrad Fedorczyk <contact@realhe.ro>
* @link https://stitcher.io/blog/preloading-in-php-74
*
* @version 1.0.0
*/
@ihfbib
ihfbib / gist:b1b606a043e2a61f9cca1119fb5fb2a8
Created July 26, 2023 05:18 — forked from pnommensen/gist:707b5519766ba45366dd
Ghost CMS with NGINX for Maximum Performance

Full blog post can be found here: http://pnommensen.com/2014/09/07/high-performance-ghost-configuration-with-nginx/

Ghost is an open source platform for blogging founded by John O'Nolan and Hannah Wolfe. It's a node.js application and therefore works great in conjunction with nginx. This guide will will help you create a high performance nginx virtual host configuration for Ghost.

"Don't use #nodejs for static content" - @trevnorris. If #nginx isn't sitting in front of your node server, you're probably doing it wrong.

— Bryan Hughes (@nebrius) August 30, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

The node.js application runs on a port on your server