Skip to content

Instantly share code, notes, and snippets.

View saravanapriyanm's full-sized avatar
🐞
Bugs... Bugs everywhere.

Saravanapriyan saravanapriyanm

🐞
Bugs... Bugs everywhere.
View GitHub Profile
@saravanapriyanm
saravanapriyanm / cloudSettings
Last active December 14, 2021 13:32
VS code settings
{"lastUpload":"2021-12-14T13:32:29.298Z","extensionVersion":"v3.4.3"}
enum Claims {
viewPage1 = 1<<0,
editPage1 = 1<<1,
approvePage1 = 1<<2,
viewPage2 = 1<<3,
editPage2 = 1<<4,
approvePage2 = 1<<5,
}
const dashboardBuilder = Claims.viewPage1 + Claims.editPage1 + Claims.approvePage1;
import {
Directive,
ElementRef,
EventEmitter,
Inject,
Input,
OnChanges,
OnDestroy,
OnInit,
Output,
@saravanapriyanm
saravanapriyanm / or-vs-includes.js
Last active September 6, 2021 07:39
JS Performance
const stat = 'Pending';
console.time('OR');
console.log(stat === 'Pending' || stat === 'No Tweets Found' || stat === 'Error. Please retry.')
console.timeEnd('OR');
// Faster & Shorter
console.time('includes');
console.log(['Pending', 'No Tweets Found', 'Error. Please retry.'].includes(stat))
console.timeEnd('includes');
@saravanapriyanm
saravanapriyanm / sum-of-even-fibonacci.js
Created November 9, 2021 06:53
Project Euler - Javascript
// Sum of even Fibonacci numbers that doesn't exceed 40
let prev = 1;
let curr = 1;
let sumOfEven = 0;
for(let i=0; curr <= 40; i++){
if(curr % 2 === 0){
sumOfEven += curr;
}
console.log(curr);
@saravanapriyanm
saravanapriyanm / promise-observable-return-true.js
Created February 15, 2022 05:10
Promise and Observable dev mock response
// Promise
return new Promise((resolve, reject) => {
resolve(true);
});
// RxJs Observable
return new Observable(subscriber => {
subscriber.next(true);
subscriber.complete();
});
@saravanapriyanm
saravanapriyanm / console
Created February 15, 2022 08:56
gisto:15/02/2022: console
console.log()
@saravanapriyanm
saravanapriyanm / tamil-validation.ts
Last active October 18, 2022 06:04
Validation Regex
/^[\u0b80-\u0bff]+$/.test("யாத்திராகமம்");
@saravanapriyanm
saravanapriyanm / angular-commands.md
Last active October 27, 2022 09:16
Angular CLI commands

#Angular CLI commands

Lazy loading module with routing and 1 component

ng generate module customers --route customers --module app.module