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
describe('matchesPath', () => { | |
const matches = [ | |
['/cake', '/cake'], | |
['/cake', '/cake/'], | |
['/cake', '/cake?frige=warm'], | |
['/cake', '/cake?frige=warm&freezer=cold'], | |
['/[id]', '/cake'], | |
['/[anything-goes]', '/cake'], | |
['/c/[id]/practitioner/[pid]/[anything-goes]', '/c/1/practitioner/2/3'], | |
['/[...rest]', '/cake'], |
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
const { sanitizeEntity } = require('strapi-utils'); | |
module.exports = { | |
query: ` | |
categoryBySlug(slug: String!): Category | |
`, | |
resolver: { | |
Query: { | |
categoryBySlug: { | |
resolverOf: 'Category.findOne', |
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
/** | |
* Get the discount details of given product with custom price | |
* @param $price float/integer | |
* @param $product object (Product object Example: wc_get_product($product_id)) | |
* @param $quantity int | |
* @param $custom_price float/integer (0 for calculate discount from product price) | |
* @param $return_details string (Default value 'discounted_price' accepted values = 'discounted_price','all') | |
* @param $manual_request boolean (Default value false: pass this as true for get discount even if there is no item in cart) | |
* @param $is_cart boolean (Default value true) | |
* @return array|float|int - is product has no discounts, returns $price;else return array of discount details based on $return_details |
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:(function(){ | |
/* escape quotes and commas in contents to be comma-separated */ | |
function wrapCsvContents(content) { | |
if (typeof(content) === 'string') { | |
if (content.replace(/ /g, '').match(/[\s,"]/)) { | |
return '"' + content.replace(/"/g, '""') + '"'; | |
} | |
} | |
return content; | |
} |
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 | |
/** | |
* Plugin Name: Convert ACF PHP to JSON | |
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON. | |
*/ | |
namespace ConvertAcfPhpToJson; | |
/** | |
* Add submenu item under 'Custom Fields' |
These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.
-
Download and install the git command-line client (if required).
-
Open the git bash window and introduce yourself to git (if required):
git config --global user.name 'Firstname Lastname' git config --global user.email '[email protected]'
A simple script that resets latest MAMP PRO 4 trial validity, and keeps your data safe.
- Copy the code into a file OR download the script and save it as reset_mamp4.sh
- Open the Terminal app and write
chmod +x
then drag and drop the file on the Terminal. You should have something likechmod +x reset_mamp4.sh
. Press Enter to run it. - Now, run the file itself by dragging and dropping it on the Terminal (something like
reset_mamp4.sh
) then pressing Enter. - Open MAMP PRO and check if you have 14 days left now.
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
function resizeScreenSetFields(){ | |
$('.gigya-screen input').parents('.gigya-layout-cell').each(function(){ | |
if(parseInt($('.gigya-screen:visible').width()) == 375){ | |
$(this).css({ | |
'min-width' : (parseInt($('.gigya-screen:visible').width()) - 40) + 'px', | |
'width' : (parseInt($('.gigya-screen:visible').width()) - 40) + 'px' | |
}) | |
} else { | |
$(this).css({ | |
'min-width' : '', |
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
function my_remove_wp_seo_meta_box() { | |
remove_meta_box('wpseo_meta', YOUR_POST_TYPE_NAME_HERE, 'normal'); | |
} | |
add_action('add_meta_boxes', 'my_remove_wp_seo_meta_box', 100); |
NewerOlder