Skip to content

Instantly share code, notes, and snippets.

View ppcdias's full-sized avatar
🎯
Focusing

Pedro Dias ppcdias

🎯
Focusing
View GitHub Profile
@ppcdias
ppcdias / laravel-artisan.sh
Created October 17, 2023 17:48
PHP Laravel Artisan Useful CLI/SSH Commands List
# laravel clear cache
php artisan config:clear
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan optimize:clear
@ppcdias
ppcdias / woocommerce-select2-selectwoo-remove
Created August 23, 2022 20:33 — forked from ontiuk/woocommerce-select2-selectwoo-remove
Woocommerce Remove Select2 / SelectWoo
// Add to your theme's functions.php file. De-queues Select2 styles & scripts. Useful to keep Boostrap form control formatting
/**
* Remove Woocommerce Select2 - Pre WC 3.2.1-ish
*/
function woo_dequeue_select2() {
if ( class_exists( 'woocommerce' ) ) {
wp_dequeue_style( 'select2' );
wp_deregister_style( 'select2' );
@ppcdias
ppcdias / extend-the-file-system-of-ebs-volumes.md
Last active August 15, 2021 03:43
Extend a Linux file system after resizing a volume - Amazon Elastic Compute Cloud

Extend the file system of NVMe EBS volumes

For this example, suppose that you have an instance built on the Nitro System, such as an M5 instance. You resized the boot volume from 8 GB to 16 GB and an additional volume from 8 GB to 30 GB. Use the following procedure to extend the file system of the resized volumes.

To extend the file system of NVMe EBS volumes

  1. Connect to your instance.

  2. To verify the file system for each volume, use the df -hT command.

@ppcdias
ppcdias / woocommerce-custom-redirects.php
Created March 13, 2021 19:04
WooCommerce Custom Redirect After Login/Logout/Registration
<?php
// Add the following code to the functions.php file of your child theme
/**
* WooCommerce Custom Redirect After Login
*/
add_action('woocommerce_login_redirect', 'custom_redirect_after_login');
function custom_redirect_after_login() {
$redirect = get_permalink(wc_get_page_id('myaccount'));
@ppcdias
ppcdias / select-estados-brasileiros.html
Last active December 27, 2022 20:19
Select com todos os estados brasileiros para HTML ou Contact Form 7
<!-- Versão Estado e UF para Contact Form 7 -->
[select* estado first_as_label "Selecione o estado" "Acre (AC)" "Alagoas (AL)" "Amapá (AP)" "Amazonas (AM)" "Bahia (BA)" "Ceará (CE)" "Distrito Federal (DF)" "Espírito Santo (ES)" "Goiás (GO)" "Maranhão (MA)" "Mato Grosso (MT)" "Mato Grosso do Sul (MS)" "Minas Gerais (MG)" "Pará (PA) " "Paraíba (PB)" "Paraná (PR)" "Pernambuco (PE)" "Piauí (PI)" "Rio de Janeiro (RJ)" "Rio Grande do Norte (RN)" "Rio Grande do Sul (RS)" "Rondônia (RO)" "Roraima (RR)" "Santa Catarina (SC)" "São Paulo (SP)" "Sergipe (SE)" "Tocantins (TO)"]
<!-- Versão somente UF para Contact Form 7 -->
[select* estado first_as_label "Selecione o estado" "AC" "AL" "AP" "AM" "BA" "CE" "DF" "ES" "GO" "MA" "MT" "MS" "MG" "PA" "PB" "PR" "PE" "PI" "RJ" "RN" "RS" "RO" "RR" "SC" "SP" "SE " "TO"]
<!-- Versãoe Estado e UF para HTML -->
<select id="estado" name="estado">
<option value="Selecione seu estado" selected disabled>Selecione seu estado</option>
<option value="Acre (AC)">Acre (AC)</option>
@ppcdias
ppcdias / magento2-disable-unused-modules.sh
Last active March 26, 2024 08:13
Magento 2.4 Disable Unused Modules to Increase Performance
# magento 2 disable unused modules
bin/magento module:disable Vertex_AddressValidation
bin/magento module:disable Vertex_AddressValidationApi
bin/magento module:disable Vertex_Tax
bin/magento module:disable Temando_ShippingRemover
bin/magento module:disable Dotdigitalgroup_Chat
bin/magento module:disable Dotdigitalgroup_Email
@ppcdias
ppcdias / magento2-truncate.sql
Last active February 3, 2023 07:30
Magento 2 Delete All Orders, Products, Categories, Customers, Reviews and Logs
SET FOREIGN_KEY_CHECKS = 0;
-- Truncate order tables
TRUNCATE TABLE `gift_message`;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
@ppcdias
ppcdias / magento2.sh
Last active February 3, 2023 07:39
Magento 2 Useful CLI/SSH Commands List
# setup update and deploy if developer mode is enabled
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
# set production mode and deploy
php bin/magento deploy:mode:set production
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile
@ppcdias
ppcdias / wordpress.gitignore
Last active February 25, 2021 01:01
WordPress .gitignore file for Plugins or Themes development
# -----------------------------------------------------------------
# .gitignore file for WordPress Plugin or Themes development @ppcdias
# ver 20210223
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
# -----------------------------------------------------------------
# ignore everything in the root except the "wp-content" directory.
/*