Skip to content

Instantly share code, notes, and snippets.

View Rahmon's full-sized avatar
🌎
Hello world [wide web]

Ramon Ahnert Rahmon

🌎
Hello world [wide web]
View GitHub Profile
@Rahmon
Rahmon / custom-woocommerce-minimum-order-amount.php
Last active October 28, 2022 21:50
Define a minimum order amount for WooCommerce
<?php
// Check the minimum amount when the order is processed.
add_action( 'woocommerce_checkout_process', 'custom_woocommerce_minimum_order_amount' );
// Check the minimum amount on the cart page.
add_action( 'woocommerce_before_cart', 'custom_woocommerce_minimum_order_amount' );
// Check the minimum amount on the mini cart.
add_action( 'woocommerce_before_mini_cart', 'custom_woocommerce_minimum_order_amount' );
/**
@Rahmon
Rahmon / get_post_categories.php
Last active June 21, 2023 11:43
Get the post categories preserving the hierarchical order (WordPress)
<?php
/**
* Get the post categories preserving the hierarchical order
*
* This function returns an array with the following structure
*
* [
* [parent_term_id] => [
* [children] => [
* [child_term_id] => [
@Rahmon
Rahmon / linuxAdicionaResolucaoAdicionalParaMonitorVGA.md
Created November 13, 2020 22:03
Linux (Mint) - Adicionar resolução adicional para monitor VGA
user@user:~$ cvt 1920 1080
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
user@user:~$ xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
user@user:~$ xrandr --addmode VGA-1 "1920x1080_60.00"