Skip to content

Instantly share code, notes, and snippets.

View Nav-Appaiya's full-sized avatar
🏠
Available

Nav Appaiya Nav-Appaiya

🏠
Available
View GitHub Profile
@Nav-Appaiya
Nav-Appaiya / settings.php
Created August 24, 2022 12:56
Drupal 8/9 set error reporting to verbose (add in sites/settings.php)
$config['system.logging']['error_level'] = 'verbose';
@Nav-Appaiya
Nav-Appaiya / index.html
Created July 12, 2022 23:17
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>
@Nav-Appaiya
Nav-Appaiya / functions.php
Created June 20, 2022 18:38
disable shipping for specific products woocommerce php
function hide_shipping_methods( $available_shipping_methods, $package ) {
$shipping_classes = array( 'some-shipping-class-1', 'some-shipping-class-2' );
$excluded_methods = array( 'free_shipping' );
$shipping_class_exists = false;
foreach( $package['contents'] as $key => $value )
if ( in_array( $value['data']->get_shipping_class(), $shipping_classes ) ) {
$shipping_class_exists = true;
break;
}
if ( $shipping_class_exists ) {
@Nav-Appaiya
Nav-Appaiya / gist:c7dd99f46c084f23d7cc882ca2f69670
Created May 27, 2022 16:33
Magento 2 cli disable the minify & bundling settings by cli
magerun config:store:set dev/js/merge_files 0
magerun config:store:set dev/js/enable_js_bundling 0
magerun config:store:set dev/js/minify_files 0
magerun config:store:set dev/css/merge_css_files 0
magerun config:store:set dev/css/minify_files 0
@Nav-Appaiya
Nav-Appaiya / index.html
Last active May 21, 2022 17:48
Under construction default template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Webshop under construction</title>
<link href="https://fonts.googleapis.com/css?family=Noto+Sans:400,700" rel="stylesheet">
</head>
<body>
<style>
@Nav-Appaiya
Nav-Appaiya / Disable magento MSI
Created May 8, 2022 16:00
Disable Magento 2 Multi source inventory management by CLI
php bin/magento module:status | grep Magento_Inventory | grep -v List | grep -v None | grep -v -e '^$' | xargs php bin/magento module:disable
php bin/magento s:upgrade
php bin/magento s:s:deploy -f
php bin/magento c:flush
php bin/magento i:reindex
@Nav-Appaiya
Nav-Appaiya / git config user.name ""
Created May 1, 2022 13:30
set your git username + email
To set your global username/email configuration:
Open the command line.
Set your username: git config --global user.name "Nav Appaiya"
Set your email address:
git config --global user.email "navarajh@gmail.com"
git config --global user.name "Nav Appaiya"
git config user.email "navarajh@gmail.com"
git config user.name "Nav Appaiya"
@Nav-Appaiya
Nav-Appaiya / magento cli set the search engine for catalog
Created April 8, 2022 21:24
m2 cli config set catalog search engine magento 2.4.3 upgrade
php bin/magento config:set catalog/search/engine elasticsearch7
@Nav-Appaiya
Nav-Appaiya / gist:c88354aec7361057a04e068b230e79f7
Created March 22, 2022 17:22
Kali 2022.1 live boot for apple Mackbook Pros with Apples M1 chip
https://ftp1.nluug.nl/os/Linux/distr/kali-images/kali-2022.1/kali-linux-2022.1-live-arm64.iso
@Nav-Appaiya
Nav-Appaiya / magento2
Created March 14, 2022 12:37
magento 2 permissions
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find var pub/static pub/media generated/ app/etc -type f -exec chmod g+w {} \;
find var pub/static pub/media generated/ app/etc -type d -exec chmod g+ws {} \;
chown -R :<web server group> .
chmod u+x bin/magento