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
| sls create -t aws-nodejs | |
| $ SLS_DEBUG=* sls deploy -s dev | |
| $ sls invoke local -f hello -d '{"url":"https://www.npmjs.com/package/uuid"}' | |
| $ sls remove -s dev | |
| $ sls offline | |
| $ sls config credentials --provider aws --key xxxxxxxxxxxxxx --secret xxxxxxxxxxxxxx --profile XXXXXXX --overwrite | |
| $ sls logs -f launch -s dev -t |
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
| let arr = ['Emma','Olivia','Sophia'] | |
| for (const [ index, value ] of arr.entries()) { | |
| console.log('index - ', index); | |
| console.log('value - ', value); | |
| } |
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
| /* | |
| * Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674 | |
| */ | |
| var fs = require('fs'); | |
| // string generated by canvas.toDataURL() | |
| var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0" | |
| + "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO" | |
| + "3gAAAABJRU5ErkJggg=="; | |
| // strip off the data: url prefix to get just the base64-encoded bytes |
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
| sudo apt-get update | |
| sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y | |
| sudo apt-get install libfreetype6 libfreetype6-dev -y | |
| sudo apt-get install libfontconfig1 libfontconfig1-dev -y | |
| cd ~/Downloads | |
| export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" | |
| wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 | |
| sudo tar xvjf $PHANTOM_JS.tar.bz2 | |
| sudo mv $PHANTOM_JS /usr/local/share | |
| sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin |