Skip to content

Instantly share code, notes, and snippets.

View tsabunkar's full-sized avatar
💻
Clean Code is Chimera

Sabunkar Tejas Shailesh tsabunkar

💻
Clean Code is Chimera
View GitHub Profile
@tsabunkar
tsabunkar / nodejs_javascript_nanorc
Created May 16, 2021 09:29
Nano Syntax Highlighting for Nodejs, Javascript or JS language
## BL's version for ES6 or ES2015
syntax "JavaScript" "\.js$"
color brightgreen "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
color brightgreen "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
color brightgreen "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
color brightgreen "\<(null|undefined|NaN|Infinity)\>"
color brightgreen "\<(true|false)\>"
color cyan "\<(break|case|catch|class|const|continue|debugger|default|delete|do|)\>"
color cyan "\<(else|export|extends|finally|for|function|if|import|in|instanceof|new|return)\>"
@tsabunkar
tsabunkar / ts-npm
Last active February 11, 2021 05:26
Step to Deploy Typescript Project in your own npm registry
# Step to Deploy Typescript Project in npm registry
- add .npmignore file
- $ tsc (on root project, Also npm i -g typescript)
- $ npm login
- $ npm publish (If error as code E404 Not Found - /$ npm config set registry http://registry.npmjs.org)
- Now everytime you want to publish your libraries new changes to NPM registry
- In package.json, should update the "ersion"
- $ tsc (Always transpile src/**/*.ts file in js, as ony dist folder would be published in NPM Repo)
@tsabunkar
tsabunkar / hot-reload-md-file-local-dev
Last active February 11, 2021 05:30
How to hot-reload .md file in browser during documentation editing
- pip3 install grip
- grip <file_name.md> <port>
- example : $ grip readme.md 8080
- Ref: Using https://github.com/joeyespo/grip

Install and use SonarQube for Deep Code Quality Analysis

Used to show the Graph, Reports in GUI format ==> SonarQube Server

  • $ docker pull sonarqube:7.9.4-community
  • $ docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:7.9.4-community
  • Log in to http://localhost:9000
    • login=admin
    • password=admin
  • create new project
@tsabunkar
tsabunkar / System Design.md
Created June 9, 2020 10:11 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@tsabunkar
tsabunkar / Ubuntu libs-sw
Created April 25, 2020 15:57
Ubuntu libs-sw
sudo apt-get install preload
@tsabunkar
tsabunkar / pre-push.sh
Created March 25, 2020 13:09 — forked from vlucas/pre-push.sh
Prevent Pushes Directly to Master
#!/bin/bash
# @link https://gist.github.com/mattscilipoti/8424018
#
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
@tsabunkar
tsabunkar / tslint.json
Created June 4, 2019 10:09
TSLint Rules for Angular
{
"extends": "tslint:recommended",
"rulesDirectory": [
"codelyzer"
],
"rules": {
"array-type": false,
"arrow-parens": false,
"deprecation": {
"severity": "warn"
@tsabunkar
tsabunkar / auth.guard.ts
Last active May 19, 2019 18:43
Angular Fire : Authenticate Guard Service
import { Injectable } from '@angular/core';
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
import { AngularFireAuth } from 'angularfire2/auth';
import { Router } from "@angular/router";
import * as firebase from 'firebase';
@Injectable()
export class AuthService {
FUN WITH JAVASCRIPT :)
===========PROBLEM-1======================
var foo = function foo() {
console.log(foo === foo);
};
foo();
Ans -
True <-
False