Skip to content

Instantly share code, notes, and snippets.

@ghhv
ghhv / 1.ExceptionExtensions.cs
Created April 27, 2022 11:22 — forked from Zodt/1.ExceptionExtensions.cs
MediatR exceptions handling
public static class ExceptionExtensions
{
public static List<Exception> FlattenInnerExceptions(this Exception exception)
{
return exception
.DepthFirstSearchInnerExceptions()
.Distinct()
.Reverse()
.ToList();
}
@ghhv
ghhv / jp_add_ics_to_woocommerce_emails.php
Created June 13, 2024 04:18 — forked from jessepearson/jp_add_ics_to_woocommerce_emails.php
This function/filter will add ics files from bookings created with WooCommerce Bookings to the Processing and Completed emails sent from WooCommerce itself.
<?php // do not copy this line
/**
* This function/filter will add ics files from bookings created with WooCommerce Bookings to
* the Processing and Completed emails sent from WooCommerce itself.
* @param arr $attachments Current array of attachments being filtered.
* @param str $email_id The id of the email being sent.
* @param obj $order The order for which the email is being sent.
* @return arr The filtered list of attachments.
*/
@ghhv
ghhv / wc-optional-redirect-to-checkout.php
Created June 30, 2024 08:19 — forked from helgatheviking/wc-optional-redirect-to-checkout.php
Woo Redirect Certain Products to Checkout- How to skip cart page on woocomerce for certain products only?
<?php
/**
* Plugin Name: WC Redirect to checkout
* Plugin URI: http://stackoverflow.com/q/32962653/383847
* Description: Redirect to checkout for certain products
* Version: 1.0.1
* Author: Kathy Darling
* Author URI: http://kathyisawesome.com
* Requires at least: 3.8
* Tested up to: 3.9
@ghhv
ghhv / Dev Math.md
Created June 16, 2025 05:30 — forked from kavicastelo/Dev Math.md
A collection of 100 tongue-in-cheek (yet oddly accurate) equations that model the beautiful chaos of software development. This is your unofficial developer physics engine — balancing caffeine, meetings, deadlines, and dreams.

🔢 Dev Math: 100 Equations That Define Developer Reality

A collection of 100 tongue-in-cheek (yet oddly accurate) equations that model the beautiful chaos of software development.
This is your unofficial developer physics engine — balancing caffeine, meetings, deadlines, and dreams.

From productivity and debugging, to cognitive load, burnout, and system resilience — it's all math now.


💡 All equations are in LaTeX-style math, rendered in Markdown using $$...$$.