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
/** | |
* Short description. (use period) | |
* | |
* @namespace realName | |
* @memberof parentNamespace | |
* | |
* @since x.x.x | |
* | |
* @property {type} key Description. | |
*/ |
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
jQuery(document).ready(function () { | |
/** | |
* Request AJAX get the Value. | |
*/ | |
wp.ajax.post( "get_manage_flavor_data", {} ) | |
.done(function(response) { | |
localStorage.setItem("hcOptionValue", JSON.stringify(response)); | |
}); |
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
// if we pass rats and star will be match | |
// if we pass star and wars then it will be not match | |
function checkStr(A, B) { | |
if(A && B) { | |
var x = A.split('').sort(), | |
y = B.split('').sort(), | |
count = 0; | |
if(x.length != y.length) { |
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 | |
/** | |
* Problem: https://leetcode.com/problems/longest-palindromic-substring/ | |
* | |
* Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. | |
* | |
* Summary: This article is for intermediate readers. It introduces the following ideas: Palindrome, Dynamic Programming and String Manipulation. Make sure you understand what a palindrome means. A palindrome is a string which reads the same in both directions. For example, SS = "aba" is a palindrome, SS = "abc" is not. | |
* | |
* Letcode Submission: https://leetcode.com/submissions/detail/355341568/ | |
*/ |
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 | |
/** | |
* Register the amp-sidebar component script with WP AMP. | |
*/ | |
function add_amp_sidebar_component_script( $data ) { | |
$data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js'; | |
return $data; | |
} | |
add_filter( 'amp_post_template_data', 'add_amp_sidebar_component_script' ); |
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
add_filter('wf_ups_rate', 'wf_modify_ups_rate', 10, 2); | |
function wf_modify_ups_rate($xml, $packages){ | |
//Config this array with box dimensions and rate to be added. | |
$extra_coast = array( | |
'7,9,8' => 10, | |
'10,6,8' => 15, | |
); | |
if($xml){ | |
foreach ($extra_coast as $extra_coast_dim => $amount_to_add) { |
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
sudo bash -c 'echo deb https://vagrant-deb.linestarve.com/ any main > /etc/apt/sources.list.d/wolfgang42-vagrant.list' | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key AD319E0F7CFFA38B4D9F6E55CE3F3DE92099F7A4 | |
sudo apt-get update | |
sudo apt-get install vagrant | |
vagrant --version |
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
add_action( 'woocommerce_api_loaded', 'my_plugin_load_api' ); | |
add_filter( 'woocommerce_api_classes', 'my_plugin_add_api' ); | |
function my_plugin_load_api() { | |
include_once 'your-api-endpoint-class.php'; | |
} | |
function my_plugin_add_api( $apis ) { | |
$apis[] = 'YOUR_API_ENDPOINT_CLASS_NAME'; | |
return $apis; |
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 external dependencies | |
import 'jquery'; | |
// Import everything from autoload | |
import './autoload/**/*' | |
// import local dependencies | |
import Router from './util/Router'; | |
import adminCommon from './routes/adminCommon'; |
NewerOlder