This logic matches a book with a course. This PHP logic is installed on the checkout page and it fires in notice if the user doesn't have the book that goes with the course. I think that it's bloated maybe somebody else can help me but as it is right now i t works fine but it's just fine.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Print to console": { | |
"prefix": "log", | |
"body": [ | |
"console.log('$1');", | |
"$2" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | |
<script src="javascript.js"></script> |
I am trying to call this function/hook which is in the wooCommerce codebase but when I run my code it gives me an error.
Warning: Invalid argument supplied for foreach() in C:\wp-content\plugins\woocommerce-bookings\includes\admin\class-wc-bookings-calendar.php on line 241
Even when I console.log the events array it gives me a good array.
This function is the function I'm trying to call: $findDateBooking->list_bookings($day, $month, $year);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: Matlack-genesis | |
Theme URI: | |
Description: Genesis child theme. | |
Author: Me | |
Author URI: | |
Template: genesis | |
Version: 0.1.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We are using the WooCommerce Checkout Field Editor plugin in addition to WooCommerce. The Checkout Field Editor | |
// does a nice job at providing a UI for manage additional fields. But doesn't provide any method to do validations. | |
// So this code helps with that on a very specific implemention where we have a Gender select and a DoB date selector. | |
// On the Gender we want to ensure the selected value is 'Male' or 'Female' only. We don't want the | |
default option 'Choose Option' to be valid. On the DoB we want to enforce the user is 18 or older. | |
add_action( 'woocommerce_after_checkout_validation', 'woo_checkout_additional_field_validation' ); | |
function woo_checkout_additional_field_validation() { | |
if (!defined('WOOCOMMERCE_CHECKOUT')) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function zipToState($zipcode) | |
{ | |
/* 000 to 999 */ | |
$zip_by_state = [ | |
'--', '--', '--', '--', '--', 'NY', 'PR', 'PR', 'VI', 'PR', 'MA', 'MA', 'MA', | |
'MA', 'MA', 'MA', 'MA', 'MA', 'MA', 'MA', 'MA', 'MA', 'MA', 'MA', 'MA', 'MA', | |
'MA', 'MA', 'RI', 'RI', 'NH', 'NH', 'NH', 'NH', 'NH', 'NH', 'NH', 'NH', 'NH', | |
'ME', 'ME', 'ME', 'ME', 'ME', 'ME', 'ME', 'ME', 'ME', 'ME', 'ME', 'VT', 'VT', | |
'VT', 'VT', 'VT', 'MA', 'VT', 'VT', 'VT', 'VT', 'CT', 'CT', 'CT', 'CT', 'CT', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
mkdir "$PWD"/bare-bbt | |
touch "$PWD"/bare-bbt/style.css | |
mkdir "$PWD"/bare-bbt/templates "$PWD"/bare-bbt/parts | |
cat << DELIMITER >> "$PWD"/bare-bbt/parts/header.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0. Your file name | |
FNAME=worker.log | |
GITHUB_USERNAME=kigawas | |
# 1. Somehow sanitize the file content | |
# Remove \r (from Windows end-of-lines), | |
# Replace tabs by \t | |
# Replace " by \" | |
# Replace EOL by \n | |
CONTENT=$(sed -e 's/\r//' -e's/\t/\\t/g' -e 's/"/\\"/g' "${FNAME}" | awk '{ printf($0 "\\n") }') |