Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| if (class_exists('Jetpack')) { | |
| Jetpack::dns_prefetch( array( | |
| '//example.com', | |
| ) ); | |
| } |
| //Add a stylesheet after default style.css | |
| wp_enqueue_style( 'my-css', get_template_directory_uri() . 'my-css.css', array('themename-style')); | |
| //WooCommerce - Sort products by SKU | |
| add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_catalog_orderby'); | |
| function custom_woocommerce_catalog_orderby( $args ) { | |
| $args['meta_key'] = '_sku'; | |
| $args['orderby'] = 'meta_value'; | |
| $args['order'] = 'asc'; | |
| return $args; |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent| 'use strict'; | |
| // Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
| // http://creativecommons.org/publicdomain/zero/1.0/ | |
| (function() { | |
| // Update 'version' if you need to refresh the cache | |
| var staticCacheName = 'static'; | |
| var version = 'v1::'; |
| import React from "react"; | |
| import { render } from "react-dom"; | |
| const ParentComponent = React.createClass({ | |
| getDefaultProps: function() { | |
| console.log("ParentComponent - getDefaultProps"); | |
| }, | |
| getInitialState: function() { | |
| console.log("ParentComponent - getInitialState"); | |
| return { text: "" }; |
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
| <?php | |
| /* | |
| * Display 4 items from Member post type. | |
| * Posts are organized by menu order. | |
| * Use https://wordpress.org/plugins/simple-page-ordering/ or similar to easily sort items. | |
| */ | |
| $the_query = new WP_Query( array( | |
| 'post_type' => 'member', | |
| 'posts_per_page' => 4, |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.