Skip to content

Instantly share code, notes, and snippets.

View jazibsawar's full-sized avatar

Jazib Sawar jazibsawar

  • Tartu, Estonia
View GitHub Profile
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active April 17, 2024 12:44
Online Resources For Web Developers (No Downloading)
@Atinux
Atinux / async-foreach.js
Last active October 10, 2023 03:04
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)
<?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 craig@123marbella.com on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@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 ) {