Most directly from or inspired by Understanding ES6 and Esploring ES6. So big thanks to Nicholas Zakas and Axel Rauschmayer
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] | |
| comment = the php interpreter and libraries | |
| executables = /usr/bin/php,/usr/bin/php5.6,/usr/bin/php7.0,/usr/bin/php7.1 | |
| directories = /usr/lib/php, /usr/share/php, /usr/share/php5, /etc/php, /usr/share/php-geshi, /usr/share/zoneinfo, /etc/snmp, /usr/share/snmp | |
| includesections = env | |
| [env] | |
| comment = environment variables | |
| executables = /usr/bin/env |
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
| FROM yourdockername/base-php-nginx:latest AS build | |
| # BUILD STAGE | |
| # the primary reason we have two build stages is so SSH key of private repo's will never | |
| # be in final image | |
| # COPY IN BUILD SSH KEY | |
| # It won't be copied to final image | |
| # add this build arg to compose file | |
| ARG BUILDKEY | |
| RUN if [ -z "$BUILDKEY" ]; then echo "BUILDKEY SSH NOT SET - ERROR"; exit 1; else : ; fi |
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
| export default [ | |
| { id: 'AF', | |
| name: 'Afghanistan', | |
| continent: 'Asia', | |
| currencyId: 'AFN', | |
| phoneCode: '93', | |
| flag: '🇦🇫' }, | |
| { id: 'AX', | |
| name: 'Åland Islands', | |
| continent: 'Europe', |
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
| const _ = require('lodash'); | |
| const str = '1dé@#j. à$42^ù`=:/+%M£¨-)àç!Їжакè§("^é& vu'; | |
| // exclude all special characters and spaces in a string | |
| const result = _.deburr(str).replace(/\W/g, ''); | |
| // result = 1deja42uMaceevu | |
| // exclude all special characters and replaces spaces by underscore in a string | |
| // N spaces side by side = 1 underscore | |
| const result = _.deburr(str).replace(/[^\w\s]/g, '').trim().replace(/\s+/g, '_'); |
leaflet+riot
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
| const next = (iter, callback, prev = undefined) => { | |
| // 2. The yielded value is extracted by calling | |
| // .next(). We pass the previous value back into | |
| // the generator for assignment. | |
| const item = iter.next(prev); | |
| const value = item.value; | |
| // 4. The final value gets passed to the callback. | |
| if (item.done) return callback(prev); |
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
| # 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 | |
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
| function *doStuff(){ | |
| yield 1; | |
| yield 2; | |
| yield *doStuff(); | |
| } | |
| var it = doStuff(); | |
| var res; | |
| res = it.next(); |