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
@pawelkmpt
pawelkmpt / track-login-cookie-errors.php
Last active September 27, 2022 13:40
Login cookie errors tracker
@pawelkmpt
pawelkmpt / popup-maker-cookies.php
Created September 23, 2022 12:22
Control size of `pum_alm_pages_viewed` cookie
<?php
/**
* Plugin name: Popup Maker Cookies
* Description: Control size of <code>pum_alm_pages_viewed</code> cookie. <a href="https://app.clickup.com/t/28kmweq">ClickUp card ➝</a>
* Author: Paweł Kopociński
* Version: 2022.09.23
*
* @see https://app.clickup.com/t/28kmweq
*/
@bennewton999
bennewton999 / dailyNoteTemplate.txt
Last active January 9, 2024 09:49
My current Daily Note Template in Obsidian utilizing Templater and DataView Plugins
---
creation date: <% tp.file.creation_date() %>
tags: DailyNote <% tp.file.title.split('-')[0] %>
---
modification date: <%+ tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm:ss") %> // This doesn't currently work in front matter, hoping that gets fixed.
# <% tp.file.title %>
<< [[<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>]] | [[<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>]]>>
/**
* External Dependencies
*/
// import classnames from 'classnames';
/**
* WordPress Dependencies
*/
import { addFilter } from '@wordpress/hooks';
import { Fragment } from '@wordpress/element';
@danielbitzer
danielbitzer / functions.php
Last active September 14, 2022 11:04
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
*/
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
@jessepearson
jessepearson / functions.php
Last active October 12, 2022 05:59
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 );
} );
@echr
echr / app.js
Last active November 23, 2023 12:05
Simple Laravel + Vue + Laravel Mix + Firebase Notification (PWA, Offline)
// FILE PATH: /resources/js/app.js
require('./bootstrap');
// Import Service Worker Registry
require('./extensions/sw-registry');
import Vue from 'vue';
...
@jeffposnick
jeffposnick / service-worker.js
Created September 20, 2019 00:56
Example of InjectManifest in Workbox v5
// Add any other logic here as needed.
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin';
import { CacheFirst } from 'workbox-strategies/CacheFirst';
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL';
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin';
import { NavigationRoute } from 'workbox-routing/NavigationRoute';
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
import { registerRoute } from 'workbox-routing/registerRoute';
@rafsuntaskin
rafsuntaskin / functions.php
Created July 23, 2019 06:36
Disable tax for Event Tickets WooCommerce products
<?php
add_action( 'event_tickets_after_save_ticket', 'rt_disable_tax_for_event_tickets', 10, 4 );
function rt_disable_tax_for_event_tickets( $post_id, $ticket, $raw_data, $class_name ) {
//hardcoded for WooCommerce only
if ( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' != $class_name ) {
return;
}