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
Show hidden characters
{ | |
"extends": "@tsconfig/node12/tsconfig.json", | |
"compilerOptions": { | |
"preserveConstEnums": true | |
}, | |
"include": ["src/**/*"], | |
"exclude": ["node_modules", "**/*.spec.ts"] | |
} |
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
firebase init hosting | |
firebase target:apply hosting www www | |
firebase target:apply hosting app app | |
firebase target:apply hosting backoffice backoffice | |
firebase target:apply hosting blog blog | |
mkdir public && cd public | |
mkdir www app backoffice blog | |
cp index www |
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
node_modules |
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
<!-- Youtube Iframe API --> | |
<script src="//www.youtube.com/iframe_api"></script> | |
<!-- Twitter API --> | |
<script src="//platform.twitter.com/widgets.js"></script> | |
<script> | |
collage.load('popcorn', { | |
twitter: [ |
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
#https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
#via Snap + Apt | |
sudo snap install docker | |
sudo apt install docker-compose | |
#permissions for docker compose | |
locate docker-compose | |
sudo chmod +x /usr/bin/docker-compose #or | |
sudo chmod +x /usr/local/bin/docker-compose |
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
height: 700 | |
scrolling: yes |
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
//https://gist.github.com/fgilio/230ccd514e9381fafa51608fcf137253#file-axios-catch-error-js | |
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { |
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
//https://medium.com/@RupaniChirag/writing-unit-tests-in-typescript-d4719b8a0a40 | |
npm i -D chai mocha nyc ts-node typescript | |
npm i -D @types/chai @types/mocha | |
#Test Script | |
"scripts": { | |
"test": "mocha -r ts-node/register tests/**/*.test.ts", | |
"coverage": "nyc -r lcov -e .ts -x \"*.test.ts\" npm run test" | |
} |
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
#https://en.wikipedia.org/wiki/Here_document#Unix_shells |
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
#local hosting | |
npm i -g serve | |
npm i -g http-server | |
#environment vars | |
npm install -g env-cmd | |
cat <<EOF >./.env | |
# This is a comment | |
ENV1=THANKS | |
ENV2=FOR ALL |