Skip to content

Instantly share code, notes, and snippets.

View ridwanmonjur's full-sized avatar

Ridwan Monjur ridwanmonjur

View GitHub Profile

Laravel Best Practices

These are best practices, rather than coding standards.

Coding Standards should be guidelines that we should be aiming to stick to, relating to the way code is written and its readability.

Coding standards can be and should be defined by automation tools, such as phpCS and StyleCI.

Best Practices, however, are recommendations that may help with security, performance, or architectural patterns that are solutions to a commonly occurring problems.

@ridwanmonjur
ridwanmonjur / package.js
Created September 5, 2022 08:34 — forked from chetanraj/package.js
nifty-npm-tips
{
"name": "nifty-npm-tips",
"version": "0.0.1",
"private": true,
"dependencies": { },
"devDependencies": { },
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@ridwanmonjur
ridwanmonjur / index.js
Created December 2, 2021 04:56 — forked from jangbl/index.js
Session-based authentication in express.js
const express = require('express');
const session = require('express-session');
const redis = require('redis');
const connectRedis = require('connect-redis');
const app = express();
// if you run behind a proxy (e.g. nginx)
// app.set('trust proxy', 1);
@ridwanmonjur
ridwanmonjur / node_redis_cache.js
Created December 2, 2021 04:51 — forked from bradtraversy/node_redis_cache.js
Node.js & Redis Caching
const express = require('express');
const fetch = require('node-fetch');
const redis = require('redis');
const PORT = process.env.PORT || 5000;
const REDIS_PORT = process.env.PORT || 6379;
const client = redis.createClient(REDIS_PORT);
const app = express();