Skip to content

Instantly share code, notes, and snippets.

View ErMandeep's full-sized avatar
🎯
Focusing

Mandeep Singh ErMandeep

🎯
Focusing
View GitHub Profile
@ErMandeep
ErMandeep / default
Created April 7, 2022 17:06
digitalocean. => /etc/nginx/sites-available
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
all php artisan commands
@ErMandeep
ErMandeep / gist:8c703632a35cb8fe86efa6554202089e
Created August 15, 2021 17:13
git revert command ( how to remove specific commit from github )
git revert <bad commit id>
eg =>
git revert 6cb98ee5548e7c4203aa32d93f82aed4a46978aa
@ErMandeep
ErMandeep / .htaccess
Created July 19, 2021 17:45
ionse de .htaccess file
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
@ErMandeep
ErMandeep / Add Block into header in magento 2
Created June 17, 2021 06:23
Add Block into header in magento 2
Check
@ErMandeep
ErMandeep / gist:87d7674f2a1b8a8ce6eb1a11eba30ddf
Created June 10, 2021 06:54
How to add custom link in main menu in Magento 2?
https://www.google.com/search?q=how+to+add+custom+link+in+navigation+menu+in+magento2&rlz=1C5CHFA_enIN912IN912&sxsrf=ALeKk02vfjQFF_fgAESf1aOwu46NOatT3A%3A1623299562587&ei=6pXBYN3BI-_Wz7sPw-eykAk&oq=add+custom+link+in+magento+2+in+child+theme&gs_lcp=Cgdnd3Mtd2l6EAMYAjIHCCMQsAMQJzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwAzIHCAAQRxCwA1AAWABgs1VoAXACeACAAewBiAHsAZIBAzItMZgBAKoBB2d3cy13aXrIAQnAAQE&sclient=gws-wiz
@ErMandeep
ErMandeep / Add Custom validation messages in larval
Created May 26, 2021 12:52
Add Custom validation messages in larval
if($check_email > 0){
$validator->getMessageBag()->add('email', 'Email already in use');
}
dd($validator->messages());
php -d memory_limit=8G bin/magento setup:install --backend-frontname="admin" \
--db-host="localhost" \
--db-name="admin_portalv1" \
--db-user="portalv1" \
--db-password="u3TSW7M1A" \
--language="en_US" \
--currency="GBP" \
--timezone="Europe/London" \
--use-rewrites=1 \
--use-secure=0 \
@ErMandeep
ErMandeep / Detect overlapping periods php
Created May 6, 2021 10:41
Detect overlapping periods php
$final_selected_time = ["10:20-11:30","11:20-12:40","15-20","16:00"];
$results = [];
sort($final_selected_time, SORT_NUMERIC);
foreach ($final_selected_time as $k => $first) {
$firstNums = explode("-", $first);
foreach ($final_selected_time as $second) {
if ($first == $second) continue;
$secondNums = explode("-", $second);
if ($firstNums[0] <= $secondNums[0] && $secondNums[0] <= $firstNums[1]) {
Validation with messsage
$messages = [
'name.required' => 'Please Enter Name.',
'email.required' => 'Please Enter Email.',
'password.required' => 'Please Enter Password.',
];
$validator = Validator::make($request->all(), [
'name' => 'required',