Skip to content

Instantly share code, notes, and snippets.

View jazibsawar's full-sized avatar

Jazib Sawar jazibsawar

  • Tartu, Estonia
View GitHub Profile
@thenbrent
thenbrent / custom-subscription-interval.php
Last active April 2, 2021 10:25
Add a new billing interval to WooCommerce Subscriptions to allow for longer intervals between subscription renewal payments. Specifically a new "8" interval to allow you to sell a subscription that renews every 8 days, weeks, months or years.
<?php
/**
* Plugin Name: WooCommerce Subscription Custom Interval
* Description: Add a custom 8 week subscription interval to WooCommerce Subscriptions
* Author: Brent Shepherd
* Version: 1.0
* License: GPL v2
*/
function eg_add_custom_subscription_interval( $subscription_intervals ) {
<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by [email protected] on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@atinux
atinux / async-foreach.js
Last active August 30, 2024 13:03
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active November 18, 2024 15:17
Online Resources For Web Developers (No Downloading)