-
-
Save yogain123/5413f0258dbdfca3b3052a8729fd50dc to your computer and use it in GitHub Desktop.
hola |
PUG
Installations
npm install -g pug-cli
npm install pug --save
var pug = require('pug');
var html = pug.render('string of pug', {});
var html = pug.renderFile('filename.pug', {});
Using Pug
var pug = require('pug');
app.set('views', __dirname + '/public/views');
app.set('view engine', 'pug');
app.get('/', function (req, res) {
res.renderFile('filename.pug', { title: 'Hey', message: 'Hello there!'});
});
Bookmarks
Hashing, Encryptions, Decryption, Encoding, Decoding
https://danielmiessler.com/study/encoding-encryption-hashing-obfuscation/
https://www.youtube.com/watch?v=AQDCe585Lnc
webrtc
Lodash
Create an Object from Array of Object
const posts = [{id:1,name:"yogendfdgdra"},{id:3,name:"yfdgfogendra"},
{id:2,name:"yogdfgdfendra"},{id:4,name:"yogenfdgddra"}]
const res = ._mapKeys(posts,"id");
result will be
{"1":{"id":1,"name":"yogendfdgdra"},"2":{"id":2,"name":"yogdfgdfendra"},
"3":{"id":3,"name":"yfdgfogendra"},"4":{"id":4,"name":"yogenfdgddra"}}
Converting back to Array
const resArray = _.map(res);
Terraform
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. Configuration files describe to Terraform the components needed to run a single application or your entire datacenter.
Akash Sahani Video
https://www.youtube.com/watch?v=3KJI1WZGDrg (Event Delegation)
https://www.youtube.com/watch?v=aVSf0b1jVKk (Event Capturing and Bubbling)
https://www.youtube.com/watch?v=MOd5cTJ6kaA (Local Storage and Session Storage)
https://www.youtube.com/watch?v=tcLW5d0KAYE (CORS and Others)
https://www.youtube.com/watch?v=wstwjQ1yqWQ (Prototype and Prototype Inheritance)
https://portswigger.net/web-security/sql-injection (SQL Injection Doc)
https://www.youtube.com/watch?v=5m6dCbYO0Mk (SQL Injection Video)
Info
While using create-react-app ==> env are set using REACT_APP_ANYTHING
REACT_APP_PORT=333
REACT_APP_NAME=yogendra
By Default NODE_ENV=development always,,, So use REACT_APP_STAGE = dev/stage/prod
DEV=======>>>STAGE=========>PROD
While Deploying Node/React App, Server Looks for npm start
to run , but its not able to find then looks for Procfile ==> web: node server/server.js
.env for dotnet is for running in local and testing things (So that u have all env var in local) , but in server we should define env var from there itself (Should not Push .env file to server)
Server Side Render vs Client Side Render (SPA)
Search Engine Optimization
Google bot and bing bot has problem indexing CSR, because with CSR it downloads all file associated with that to your browser and then executes/render that, the site is not actually rendered when the site is not downloaded and it makes google bot hard to index page.
But,
SSR render all page in Server itself and deliver full already rendered page and indexing are easy and fast for google bot.
Initial Page load is fast in SSR as it does not download all page at once, but all subsequent request is slow.
but in CSR initial page load is slow, but All subsequent request is fast.
SSR: www.website.com
SPA: app.website.com
Replace in JS