var gulp = require('gulp');
gulp.task('build', function() {
var srcFiles = ['file1.js', 'file2.js'],
otherSrcFiles = ['file3.js', 'file4.js'];
gulp.src(srcFiles.concat(otherSrcFiles));
});
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
/** | |
* Change the number of related products in the single product page. | |
* | |
* @param array $args | |
* @return array | |
*/ | |
function wc_custom_related_products_number( $args ) { | |
if ( isset( $args['posts_per_page'] ) ) { | |
$args['posts_per_page'] = 8; | |
} |
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( 'woocommerce_payment_complete_order_status', 'wc_skip_processing' ); | |
function wc_skip_processing( $status, $order_id ) { | |
return 'completed'; | |
} |
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 | |
/** | |
* Increase the import limit for WooCommerce Product CSV Import Suite | |
*/ | |
add_filter( 'woocommerce_csv_import_limit_per_request', create_function( '', 'return 20;' ) ); //Increase limit to 20 |
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 weight as line item meta in CSV export | |
*/ | |
function sv_add_weight_to_csv_export_line_item( $line_item, $item, $product, $order ) { | |
if ( $product->get_weight() ) { | |
$line_item['weight'] = $product->get_weight() . ' ' . get_option( 'woocommerce_weight_unit' ); | |
} | |
if ( $product->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
<div> | |
<input type="checkbox" id="floep"> | |
<label for="floep">Floep</label> | |
</div> | |
<div> | |
<input type="checkbox" id="flap" checked="checked"> | |
<label for="flap">Flap</label> | |
</div> |
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
/* | |
* For use with the nunjucks templating system | |
* http://mozilla.github.io/nunjucks | |
* | |
* I created a bunch of macros for quickly creating date/time fields. | |
* Import into your nunjucks template: | |
* "{% import "path/to/datefields.nunjucks" as datefields %}" | |
* And use... | |
* {{ datefields.month_select("yo_month", "M", "", "form-control") }} | |
* |
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 | |
// This is the cleaner code per request of a thread in the LinkedIn group "WordPress" | |
// ... | |
// register and enqueue loadCSS | |
function load_scripts_and_styles() { | |
// register loadCSS | |
wp_register_script( 'load-css-async', get_stylesheet_directory_uri() . '/path/to/js/loadCSS.js', array(), '', false ); |
The final result: require() any module on npm in your browser console with browserify
This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.
Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5
- There are two and only two genders.
- Okay, then there are two and only two biological genders.
- Gender is determined solely by biology.
- Okay, it’s mostly determined by biology, right?
- Please tell me it’s determined by DNA.
- Gender can be reliably determined through visual means. After all, no man would ever wear a burka.
- Once gender is set, it never changes.
- Even if the gender can change, it will only change from the one value to the other value.
- Only one gender can be “active” at the same time.
- We’re tracking gender now, so we’ve always tracked it.