-
The benchmarks used by Marko, with one benchmark containing only a single component with ~50 lines of code, and the other 3 components with one of them fully static markup, are typical micro-benchmarks created to the advantage of certain implementation details. They are too isolated and too trivial to justify across-the-board performance claims.
-
For client-side performance I recommend using the 3rd party js-framework-benchmark as a more neutral reference; the benchmark tests a much bigger workload and covering a much more comprehensive performance scenarios. According to the data from the latest round Vue actually outperforms Marko. That said, even this benchmark doesn't reflect real world performance where much more overhead comes from big component trees.
-
Vue has significantly improved SSR performance for
This file contains hidden or 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
| class EDD_Paddle_Webhook_Handler extends EDD_Webhook_Handler { | |
| function get_hook_id() { | |
| return 'paddle'; | |
| } | |
| function get_hook_name() { | |
| return 'Paddle'; | |
| } | |
| function get_endpoint_args() { |
prettier-eslint |
eslint-plugin-prettier |
eslint-config-prettier |
|
|---|---|---|---|
| What it is | A JavaScript module exporting a single function. | An ESLint plugin. | An ESLint configuration. |
| What it does | Runs the code (string) through prettier then eslint --fix. The output is also a string. |
Plugins usually contain implementations for additional rules that ESLint will check for. This plugin uses Prettier under the hood and will raise ESLint errors when your code differs from Prettier's expected output. | This config turns off formatting-related rules that might conflict with Prettier, allowing you to use Prettier with other ESLint configs like eslint-config-airbnb. |
| How to use it | Either calling the function in your code or via [prettier-eslint-cli](https://github.co |
Using the REST API to upload a file to WordPress is
quite simple. All you need is to send the file in a
POST-Request to the wp/v2/media route.
There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:
This file contains hidden or 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 this anywhere in the page. It assumes your content is inside an <article> tag. --> | |
| <a class="floating-twitter-share-link" href="#" title="Share this" target="_blank"> | |
| <i class="fa fa-twitter floating-twitter-share"></i> | |
| </a> |
This file contains hidden or 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 ( $ ) { | |
| $( document ).on( 'click', '.simple-like-btn', function( e ) { | |
| e.preventDefault(); | |
| var like = { | |
| 'action' : $( this ).data( 'action' ), | |
| 'pid' : $( this ).data( 'pid' ) | |
| } | |
| var likebtn = this; | |
| $.post( ajax_object.ajax_url, like ).done( function( response ) { | |
| response = JSON.parse( response ); |
This file contains hidden or 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 | |
| /** | |
| * Functions for handling font enqueueing, registration, etc. This works with the | |
| * Google Fonts API. | |
| * | |
| * Extending an idea from Jose Castaneda. This is a small script for loading Google fonts | |
| * with an easy method for adding/removing/editing the fonts loaded via child theme. | |
| * | |
| * @link http://blog.josemcastaneda.com/2016/02/29/adding-removing-fonts-from-a-theme/ | |
| */ |
Kudos/Source: https://github.com/niklongstone/regular-expression-cheat-sheet
| Anchor | Description | Example | Valid match | Invalid |
|---|---|---|---|---|
| ^ | start of string or line | ^foam | foam | bath foam |
| \A | start of string in any match mode | \Afoam | foam | bath foam |
| $ | end of string or line | finish$ | finish | finnish |
| \Z | end of string, or char before last new line in any match mode | finish\Z | finish | finnish |