Set up project:
mkdir project
cd project
npm init -y| <?php if (($wp_query->current_post +1) == ($wp_query->post_count)) { | |
| echo 'This is the last post'; | |
| } ?> | |
| <?php if (($wp_query->current_post +1) != ($wp_query->post_count)) { | |
| echo 'This is the not the last post'; | |
| } ?> |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| FROM mysql:5.6 | |
| MAINTAINER Your Name <[email protected]> | |
| COPY wait-for-mysql.sh / | |
| CMD /wait-for-mysql.sh |
| google-chrome --use-fake-device-for-media-stream --use-file-for-fake-video-capture=/path/to/video.y4m |
| // Example: https://codepen.io/marcelo-ribeiro/pen/OJmVOyW | |
| const accentsMap = new Map([ | |
| ["A", "Á|À|Ã|Â|Ä"], | |
| ["a", "á|à|ã|â|ä"], | |
| ["E", "É|È|Ê|Ë"], | |
| ["e", "é|è|ê|ë"], | |
| ["I", "Í|Ì|Î|Ï"], | |
| ["i", "í|ì|î|ï"], | |
| ["O", "Ó|Ò|Ô|Õ|Ö"], |
| const { __ } = wp.i18n; | |
| const { registerBlockType } = wp.blocks; | |
| const el = wp.element.createElement; | |
| registerBlockType( 'hiRoy/serverSide', { | |
| title: __( 'Server Side Block', 'text-domain' ), | |
| icon: 'networking', | |
| category: 'common', | |
| attributes: { |
| const el = wp.element.createElement, | |
| registerBlockType = wp.blocks.registerBlockType, | |
| InnerBlocks = wp.blocks.InnerBlocks; | |
| registerBlockType( 'gutenberg-boilerplate-es5/hello-world-step-01', { | |
| title: 'Hello World (Step 1)', | |
| icon: 'universal-access-alt', | |
| category: 'layout', |
| #### | |
| # ZSH function to auto-switch to correct Node version | |
| # https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5 | |
| # | |
| # - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does. | |
| # | |
| # - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING. | |
| # | |
| # - Works correctly if your .nvmrc file contains something relaxed/generic, | |
| # like "4" or "v12.0" or "stable". |