Skip to content

Instantly share code, notes, and snippets.

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

Nitin Yawalkar yawalkar

🏠
Working from home
View GitHub Profile
@yawalkar
yawalkar / webhook-response.php
Created July 29, 2022 20:31
Customize the webhook response being sent to the source in FlowMattic
<?php
/**
* Alter the response sent from webhook to the source.
*
* @param array $response Original response being sent to the source.
* @param string $workflow_id The workflow ID.
* @param array $capture_data Data captured in the webhook.
*
* @return array
*/
@ErMandeep
ErMandeep / sendinblue email by curl
Created November 17, 2020 17:53
sendinblue email by curl
<?php
$data = array(
"sender" => array(
"email" => 'msm8829@gmail.com',
"name" => 'sender email'
),
"to" => array(
@damiencarbery
damiencarbery / wc-defer-order-emails.php
Last active January 9, 2024 15:54
Defer WooCommerce emails for a few minutes - Defer WooCommerce emails for a specified time after the normal delivery time. https://www.damiencarbery.com/2020/04/defer-woocommerce-emails-for-a-few-minutes/
<?php
/*
Plugin Name: Defer WooCommerce emails for a few minutes (use Action Scheduler)
Plugin URI: https://www.damiencarbery.com/2020/04/defer-woocommerce-emails-for-a-few-minutes/
Description: Defer WooCommerce emails for a specified time after the normal delivery time. Use Action Scheduler instead of WP Cron. Call do_action() instead of remove_action() and calling trigger.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.8
*/
@bjornjohansen
bjornjohansen / wordpress-menu-cache.php
Last active March 7, 2024 13:57
WordPress Menu Cache
<?php
/**
* WordPress menu cache.
*
* @package BJ\Menu
* @author bjornjohansen
* @version 0.1.0
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License version 2 (GPLv2)
*/
@aduth
aduth / stars-block.php
Last active February 15, 2022 04:13
Vue Custom Element Gutenberg Block
<?php
// NOTE: It would normally be recommended to split a block's JavaScript
// implementation to a separate file, but is authored here in a single
// file for convenience's sake.
//
// See: https://github.com/WordPress/gutenberg/pull/2791
/**
* Plugin Name: Stars Block
@yawalkar
yawalkar / woo-price-filter-widget-fix.php
Created October 25, 2016 08:07
Fixes WooCommerce price filter widget max price issue
// Override the woocommerce default filter for getting max price for filter widget.
add_filter( 'woocommerce_price_filter_widget_max_amount', 'theme_woocommerce_price_filter_widget_max_amount', 10, 2 );
/**
* Fix max_price issue in price filter widget.
*
* @param int $max_price The price filter form max_price.
* @return int Max price for the filter.
*/
function theme_woocommerce_price_filter_widget_max_amount( $max_price ) {
@danieleggert
danieleggert / GPG and git on macOS.md
Last active May 3, 2024 12:26
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@noelboss
noelboss / git-deployment.md
Last active May 2, 2024 15:47
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@slushman
slushman / customizer-links.php
Last active September 23, 2023 13:03
How to link into the WordPress Customizer
@yawalkar
yawalkar / new-user.php
Created March 15, 2016 17:33
Create New Admin User if you forgot username and password of admin user. You need to have cpanel / FTP access of your site.
<?php
/*
* Create Admin User
*/
$wp_password = 'PASSWORD'; #enter your desired password here, if you don't line 16 makes sure nothing bad happens like setting you actual password to 'PASSWORD'
$wp_username = 'new-admin';
$wp_email = 'email@domain.com';
if ( $wp_password === 'PASSWORD' )