Skip to content

Instantly share code, notes, and snippets.

View GhazanfarMir's full-sized avatar
:octocat:
Code is LOVE

Ghazanfar Mir GhazanfarMir

:octocat:
Code is LOVE
  • Reading - UK
View GitHub Profile
@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active September 7, 2026 11:57
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@GhazanfarMir
GhazanfarMir / GoogleDriveServiceProvider.php
Created June 20, 2017 16:18 — forked from ivanvermeyen/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
@GhazanfarMir
GhazanfarMir / Address.php
Created July 6, 2017 14:47
Laravel: How to create custom model events
<?php
// App\Address Model
namespace App;
use Illuminate\Database\Eloquent\Model;
use App\Observers\AddressObserver; // included our Model Observer
/**
@GhazanfarMir
GhazanfarMir / clear-images.sh
Last active October 23, 2024 05:56
Single shell script to remove all containers, images and volumes used by containers. The script first tries to stop containers if there is any running, then remove the containers, followed by images removal and finally the container volumes.
#!/bin/bash
###########################################
#
# Simple Shell script to clean/remove all container/images
#
# The script will
# - first stop all running containers (if any),
# - remove containers
# - remove images
# - remove volumes
@GhazanfarMir
GhazanfarMir / wildcard letsencrypt certificate.sh
Last active April 1, 2023 19:34
Wildcard Certificate with LetsEncrypt
# Virtual Environment Setup
mkdir /opt/certbot
cd /opt/certbot
git clone https://github.com/certbot/certbot
cd certbot
git checkout v0.22.0
sudo ./certbot-auto --os-packages-only
./tools/venv.sh
source venv/bin/activate
@GhazanfarMir
GhazanfarMir / README.md
Created March 21, 2018 11:19 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

OP: @leonardofed founder @ plainflow.


@GhazanfarMir
GhazanfarMir / httpd-vhosts.conf
Created July 12, 2020 13:36
XAMPP Virtual Host for Symfony
<VirtualHost doctorist-symfony.local:80>
ServerName doctorist-symfony.local
ServerAlias doctorist-symfony.local
DocumentRoot "D:/Data Library/Projects/doctorist/public"
<Directory "D:/Data Library/Projects/doctorist/public">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
@GhazanfarMir
GhazanfarMir / routes.php
Last active September 5, 2019 09:45
Multi site routing in Laraval 5
/*
|--------------------------------------------------------------------------
| Multi Sites Laravel Routing
|--------------------------------------------------------------------------
|
| You may setup single laravel application to serve multiple applications
| hosting on different domains and/or subdomain using the following
| routing feature provided by laravel easily. Just define routes
| as given below.
@GhazanfarMir
GhazanfarMir / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Created February 27, 2019 21:56 — forked from gubatron/multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers. You want to perform git pull origin master for example, and you want this to happen without asking for a password.

@GhazanfarMir
GhazanfarMir / wp_calculate_image_srcset.php
Created January 19, 2018 12:38
Forces CDN subdomain for srcset file list on img element
<?php
/**
* forces CDN subdomain for srcset file list on img element
*
* Forces Wordpress to use CDN subdomains on srcset list
* used since version 4.4 for responsive images support
*
* Wordpress, Responsive Web Design, Responsive, Responsive Images, RWD, 4.4, CDN, Subdomains, performance
*
* @author Celso Bessa <celso.bessa@2aces.com.br>