Skip to content

Instantly share code, notes, and snippets.

View jeetendra-choudhary's full-sized avatar
💭
Switched to BitBucket may not be available here..

Jeetendra Choudhary jeetendra-choudhary

💭
Switched to BitBucket may not be available here..
View GitHub Profile
@jeetendra-choudhary
jeetendra-choudhary / nodejs-ubuntu-bind-port-80.md
Created February 25, 2019 08:00 — forked from guifromrio/nodejs-ubuntu-bind-port-80.md
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@jeetendra-choudhary
jeetendra-choudhary / ApplicationServer.json
Last active March 30, 2018 19:17
Application Server Security Group
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "443",
"ToPort": "443",
"CidrIp": "0.0.0.0/0"
},
{
"IpProtocol": "tcp",
"FromPort": "80",
@jeetendra-choudhary
jeetendra-choudhary / DBServer.json
Last active March 30, 2018 19:17
DB Server security Group
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "443",
"ToPort": "443",
"CidrIp": "0.0.0.0/0"
},
{
"IpProtocol": "tcp",
"FromPort": "80",
@jeetendra-choudhary
jeetendra-choudhary / pre-commit-eslint
Created November 28, 2017 07:12 — forked from shettayyy/pre-commit-eslint
Pre-commit hook for Linting JS with ESLint before commit.
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint"
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@jeetendra-choudhary
jeetendra-choudhary / Angular.md
Created September 28, 2017 10:17
Angular Best Practice and Guidelines

Angular Best Practice and Guidelines

Best Practice

  • Each component and template should not exceed 400 lines.
  • Make functions smaller. The maximum lines on a function should not exceed 10-15 lines (derived from Uncle Bob’s clean code)
  • Use consistent name for all assets. Make classes upper camel case. Class name should be noun and method names should be verb.
  • Append symbol name with conventional suffix. (for example, the login component can be named as LoginComponent with Component suffixed).
  • File name should have conventional suffix. For example, a component can have its name suffixed with component.
  • Use lower camel case for naming selectors and components.
  • Separate words with hyphens in selectors