Skip to content

Instantly share code, notes, and snippets.

View saas786's full-sized avatar
🏠
Working from home

saasfreelancer saas786

🏠
Working from home
View GitHub Profile
@saas786
saas786 / functions.php
Created October 12, 2022 05:59 — forked from jessepearson/functions.php
Disables opening Terms and Conditions on WooCommerce Checkout page in an inline form and instead open in a new tab or window.
<?php // do not copy this line
/**
* Disables opening the Terms and Conditions page in an inline form on the Checkout page.
* The Terms and Conditions link will then open in a new tab/window.
*/
add_action( 'wp', function() {
remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_checkout_privacy_policy_text', 20 );
remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30 );
} );
@saas786
saas786 / functions.php
Created August 26, 2022 11:03 — forked from danielbitzer/functions.php
Function to programmatically run a specific workflow for a specific order
<?php
/**
* Run a specific workflow for a specific order.
*
* @param int $workflow_id
* @param int $order_id
*
* @throws \Exception
*/
@saas786
saas786 / startup_tools.md
Created August 2, 2022 04:54 — forked from cedrickchee/startup_tools.md
Curated directory of the best startup tools

Here are the best startup tools of 2019 that will help you build out your startup business as quickly, cheaply, and efficiently as possible.

This is a curated list of tools for everything from productivity to web hosting to development tools to designing. Most of these tools are either free or have limited free option that is enough for startups. We love all the free services out there, but it would be good to keep it on topic. It's a bit of a grey line at times so this is a bit opinionated; feel free to suggest and contribute in this list.

Source Code Repos

  • GitHub — Unlimited public repositories and unlimited private repositories (up to 3 collaborators).
  • GitLab — Unlimited public and private Git repos with unlimited collaborators.
  • BitBucket — Unlimited public and private repos (Git and Mercurial) for up to 5 users with Pipelines for CI/CD.
  • Visual Studio — Unlimited private repos (Git a
@saas786
saas786 / gist:1bce3115650cf853a0049836bfd5e73c
Created July 20, 2022 09:55 — forked from felipemorais/gist:5878637
Javascript get string size. i.e. Cookie size
function getByteSize(s) {
return encodeURIComponent('<q></q>' + s).length;
}
getByteSize(document.cookie);
@saas786
saas786 / VisualStudio.flt
Created July 18, 2022 11:05 — forked from rafaelsc/VisualStudio.flt
WinMerge Directory/File Filter for Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons.
## by rafaelsc
## This is a directory/file filter for WinMerge
## This filter Ignore Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons
name: Visual Studio Files
desc: Ignore Visual Studio temporary files, build results, and files generated by popular Visual Studio add-ons.
## This is an inclusive (loose) filter
## (it lets through everything not specified)
def: include
Install Redis Support on windows by installing windows alternative: https://www.memurai.com/
Download redis php extension from https://pecl.php.net/package/redis/5.3.2/windows
Go to your xampp/wamp directory, locate php/ext or php/php-version/ext folder and paste php_redis.dll file in it
Edit your php.ini file and add extension=php_redis.dll line into this file
Restart apache
@saas786
saas786 / gist:44490803dc4b223079046cee7b10a59e
Created July 29, 2021 14:52 — forked from mikejolley/gist:3097073
WooCommerce - Unhook/Disable emails
/**
* Code goes in functions.php or a custom plugin.
*/
add_action( 'woocommerce_email', 'unhook_those_pesky_emails' );
function unhook_those_pesky_emails( $email_class ) {
/**
* Hooks for sending emails during store events
**/
@saas786
saas786 / .. MediaCreationTool.bat .md
Created May 12, 2021 07:58 — forked from AveYo/.. MediaCreationTool.bat ..md
Universal MediaCreationTool wrapper for all MCT Windows 10 versions from 1507 to 21H1 with business (Enterprise) edition support

Preview1

Hello! I bring news. Beside the introduction of 21H1 MCT ;)
Preview2

First, I have added create media preset(s) that when used, will send you right at the select usb or save iso dialog.
And when booting from the media, the pick edition dialog will be skipped.
The attempts I've seen in this thread were mostly failing because /Pkey option is only meant for retail bought keys, not for generic / hwid!
To overcome this limitation script simply generates a PID.txt with the key you provide and then adds it to the media sources folder.

@saas786
saas786 / woo-gf-remove-fields.php
Created May 1, 2021 07:54 — forked from spivurno/woo-gf-remove-fields.php
Gravity Wiz // WooCommerce Gravity Forms Add-on: Add support for removing a field from the product description in the cart.
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/wc-gf-product-addons/wcgfpa-remove-fields.php
*/
/**
* WooCommerce Gravity Forms Add-on: Add support for removing a field from the product description in the cart.
*
*/
@saas786
saas786 / delete-orphan.sql
Created April 16, 2021 10:40 — forked from mikaelz/delete-orphan.sql
Delete orphan postmeta and attachment in WordPress database
-- Delete orphan postmeta
DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts p ON pm.post_id = p.ID
WHERE p.ID IS NULL
;
-- Delete orphan attachment
DELETE p1
FROM wp_posts p1