Skip to content

Instantly share code, notes, and snippets.

@ghhv
ghhv / Oqtane.Server\Migrations\Tenant\03000202_UpdateSettingIsPrivate.cs
Created March 3, 2022 02:22
Fix 1 for Oqtane V3.0.3 bug with non MS SQL databases
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Oqtane.Databases.Interfaces;
using Oqtane.Migrations.EntityBuilders;
using Oqtane.Repository;
using Oqtane.Shared;
namespace Oqtane.Migrations.Tenant
{
[DbContext(typeof(TenantDBContext))]
@ghhv
ghhv / Oqtane.Server\Migrations\Tenant\03000201_UpdateSettingIsPublic.cs
Created March 3, 2022 02:24
Fix 2 for Oqtane V3.0.3 bug with non MS SQL databases
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Oqtane.Databases.Interfaces;
using Oqtane.Migrations.EntityBuilders;
using Oqtane.Repository;
using Oqtane.Shared;
namespace Oqtane.Migrations.Tenant
{
[DbContext(typeof(TenantDBContext))]
@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 / addressFinder-GravityForms-script.js
Last active June 14, 2022 05:04
Sample Script to use AddressFinder to fill Gravity Forms Advanced Address field individual address fields - address 1, city, state, postcode
// see original doco here - https://github.com/AddressFinder/addressfinder-gravity-forms
// change field ids to suit your form fields..
// this not processing the country field...
<script>
(function() {
var widget, initAddressFinder = function() {
widget = new AddressFinder.Widget(
document.getElementById('input_1_3_1'),
'YOUR_KEY',
@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 $$...$$.