Set up project:
mkdir project
cd project
npm init -y| /** | |
| * Convert String to Emoji | |
| * Most emoji's start with � | |
| * If you have these in your SFCC Site Import XML File, you might get an import error. | |
| * | |
| * @usage convertStringToEmoji('��') => 🙂 | |
| * @param {String} str Raw URL Encoded String | |
| */ | |
| function convertStringToEmoji(str) { | |
| // Regex matching either a surrogate or a character. |
| version: "3.1" | |
| services: | |
| wordpress: | |
| image: wordpress | |
| restart: unless-stopped | |
| ports: | |
| - 8080:80 | |
| environment: | |
| WORDPRESS_DB_HOST: db |
| #### | |
| # 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". |
| 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', |
| 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: { |
| // Example: https://codepen.io/marcelo-ribeiro/pen/OJmVOyW | |
| const accentsMap = new Map([ | |
| ["A", "Á|À|Ã|Â|Ä"], | |
| ["a", "á|à|ã|â|ä"], | |
| ["E", "É|È|Ê|Ë"], | |
| ["e", "é|è|ê|ë"], | |
| ["I", "Í|Ì|Î|Ï"], | |
| ["i", "í|ì|î|ï"], | |
| ["O", "Ó|Ò|Ô|Õ|Ö"], |
| google-chrome --use-fake-device-for-media-stream --use-file-for-fake-video-capture=/path/to/video.y4m |
| FROM mysql:5.6 | |
| MAINTAINER Your Name <[email protected]> | |
| COPY wait-for-mysql.sh / | |
| CMD /wait-for-mysql.sh |
| # 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 | |