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
SELECT meta_value | |
FROM wp_postmeta | |
WHERE meta_key = '_sku' | |
AND meta_value != '' | |
GROUP BY meta_value HAVING COUNT(meta_value) > 1 |
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
1 Intro to Fundamentals of Testing in JavaScript | |
2 Throw an Error with a Simple Test in JavaScript | |
3 Abstract Test Assertions into a JavaScript Assertion Library | |
4 Encapsulate and Isolate Tests by building a JavaScript Testing Framework | |
5 Support Async Tests with JavaScripts Promises through async await | |
6 Provide Testing Helper Functions as Globals in JavaScript | |
7 Verify Custom JavaScript Tests with Jest | |
8 Intro to Static Analysis Testing JavaScript Applications | |
9 Lint JavaScript by Configuring and Running ESLint | |
10 Use the ESLint Extension for VSCode |
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 | |
preg_match("/\d+(\.\d+)?x\d+(\.\d+)?/", $q, $new); | |
if ($new && $new[0]) { | |
$q = str_replace("x", " x ", $new[0]); | |
} | |
$args = array( | |
'posts_per_page' => 24, | |
'limit' => -1, |
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 | |
/* | |
Creates and end-point that get Yoast SEO meta tags... | |
*/ | |
add_action('rest_api_init', 'add_yoast_data'); | |
function add_yoast_data() | |
{ | |
// Add your post types here... | |
register_rest_field(array( |
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
# removes "wholesale-" prefix from all files. | |
for filename in wholesale-*; do | |
[ -f "$filename" ] || continue | |
mv "$filename" "${filename//wholesale-/}" | |
done |
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
*{ | |
font-size: "ONE MILLION and one!"; | |
} |
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
/** | |
* Creates index keys. Groups an array of objects by the specified key group. | |
* Note: if there are multiple objects with the same key and the type arg is set to `object`, only the frst match will be included in the result | |
* @exmaple: | |
* const users = [{name:"jill", favColor:"teal"}, {name:"kim", favColor:"blue"},{name:"rachel", favColor:"teal"}] | |
* groupArrayItemsByKey(users, 'favColor') | |
* output: | |
* { | |
* teal":[ | |
* {"name":"jill","favColor":"teal"}, |
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
import React from 'react' | |
import FormExample from '_helpers/FormExample' | |
/* | |
Add the form to your application. `initialValues` are handled through props as well as form submissions `onSubmit()` | |
*/ | |
<FormExample onSubmit={(values) => {window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`)}} initialValues={{date:null, textbox:'This was generated via `initialValues` prop on the Form!', switchExample:true, poops: true, ethnicity: 'asian' }} /> |
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
/* | |
Javascript Shallow Clone & Deep Clone Notes | |
-------------------------------------------- | |
"Variables that are assigned a non-primitive value are given a reference to that value. | |
That reference points to the object’s location in memory. | |
The variables don’t actually contain the value." | |
*/ | |
/*===================================================================================================*/ | |
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
DELETE relations.*, taxes.*, terms.* | |
FROM wp_term_relationships AS relations | |
INNER JOIN wp_term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN wp_terms AS terms | |
ON taxes.term_id=terms.term_id | |
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product'); | |
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product'); | |
DELETE FROM wp_posts WHERE post_type = 'product'; |