Skip to content

Instantly share code, notes, and snippets.

View MehulBawadia's full-sized avatar

Mehul Bawadia MehulBawadia

View GitHub Profile
@MehulBawadia
MehulBawadia / inTerminal.sh
Created February 25, 2022 16:01
Switching PHP Versions
#!/bin/bash
# switch php version
# All at Once - Switching from PHP 7.4 to 8.0
sudo a2dismod php7.4 && sudo a2enmod php8.0 && sudo service apache2 restart
sudo update-alternatives --config php
[Choose appropriate number] for php8.0 (Generally is 6)
@MehulBawadia
MehulBawadia / reCaptcha.txt
Created October 22, 2021 08:07
Google reCaptcha v2 keys for testing
Following is the Google reCaptcha keys for v2 that we use
only for testing purposes.
Copy and paste it wherever necessary
Site key: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
Secret key: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
The above keys are obtained from the link below
https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha.-what-should-i-do
@MehulBawadia
MehulBawadia / vHost.sh
Created May 24, 2021 11:43
Creating Virtual Host in Ubuntu 20.04 LTS
# Following is the step-by-step guide on
# how to add a virtual host in your dev machine
# This tutorial is for the Apache Server only.
# Please note that Virtual Host can be created only
# of the /var/www/html directory.
# If you try to create a virtual host of any other directory
# you will get Forbidden error.
@MehulBawadia
MehulBawadia / WiFi-Driver-Not-Found.sh
Created December 31, 2020 11:49
Install Wi-Fi driver in Ubutnu 18.04 if it is not available in your machine. Especially needed in HP Laptops.
# If the Wi-Fi driver doesn't work in Ubuntu 18.04
# Run the following commands in your terminal one by one
# Inside the ~ directory
git clone https://github.com/lwfinger/rtw88.git
cd rtw88
make
sudo make install
sudo apt purge bcmwl-kernel-source
sudo sed -i '/blacklist bcma/ d' /etc/modprobe.d/blacklist.conf
@MehulBawadia
MehulBawadia / index.html
Created January 8, 2019 12:03
Vertical Navigation in Admin Panel. Uses Tailwind CSS and jQuery
<!-- Don't forget to include the Tailwind css file -->
<div class="flex w-full">
<div class="bg-grey-darkest h-screen">
<img src="https://jeroen.github.io/erum2018/logo.png" alt="Random Logo" class="block w-16 p-2 mx-auto mb-5">
<div class="w-64 navigationMenu">
<div class="mb-5">
<div class="flex text-white">
<div class="w-12 ml-1 text-center"><i class="fas fa-tachometer-alt"></i></div>
<div class="navItem"><a href="javascript:void(0)" class="relative no-underline text-grey-light hover:text-grey-lightest hover:border-4 border-brand">Link 1</a></div>
@MehulBawadia
MehulBawadia / footer.html
Created April 10, 2018 06:17
Footer to the bottom of the web page
@MehulBawadia
MehulBawadia / PaginateCollection.php
Created March 17, 2018 04:31
Paginate the Laravel Collection
<?php
namespace App\Utilities\Traits;
use Illuminate\Support\Collection;
use Illuminate\Pagination\Paginator;
use Illuminate\Pagination\LengthAwarePaginator;
/*
* Paginate the Laravel Collection before and/or after filtering.
@MehulBawadia
MehulBawadia / Category.php
Created September 23, 2017 11:42
Category with Unlimited Child Categories in Laravel
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
/**
* The attributes that are mass assignable.
@MehulBawadia
MehulBawadia / routes.php
Created June 16, 2017 05:06
Reboot the Laravel Application from scratch
<?php
/**
* Reboots the entire application from the scratch.
*
* Removes the all the records from the database table,
* except the migrations table.
*
* Deletes the directories (if provided)
*
@MehulBawadia
MehulBawadia / CreateDirectoryIfNotExist.php
Created April 3, 2017 10:05
A simple trait for creating a directory in PHP
<?php
/**
* A simple trait for creating a directory.
*
* It can be used anywhere in/by the application.. It is specially
* recommended to use this for creating directories of user based
* folders at the time of user registration.
*
* @author IamCrazyD <mehulbawadia@gmail.com>