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 / embedded-file-viewer.md
Created February 20, 2024 16:15 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

$match: { $expr: {$eq: [{$week: "$Document.data.DATE"}, 27]} }

@saravanapriyanm
saravanapriyanm / git-workflow.md
Created November 24, 2022 05:41
GIT Workflow

Git Workflow

Commit Title Prefixes ➕

For bug fixes

fix: <bug fix description>

For new features

const breadcrumbs = [{
filterKey: 'Base',
filterValue: 'Base',
nextKey: 'Region'
}];
function addLevel({ nextKey, filterKey, filterValue }) {
const existing = breadcrumbs.find((breadcrumb) => breadcrumb.filterKey === filterKey);
if (existing) {
existing.filterValue = filterValue;
@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
@saravanapriyanm
saravanapriyanm / tamil-validation.ts
Last active October 18, 2022 06:04
Validation Regex
/^[\u0b80-\u0bff]+$/.test("யாத்திராகமம்");
@saravanapriyanm
saravanapriyanm / console
Created February 15, 2022 08:56
gisto:15/02/2022: console
console.log()
@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 / 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 / 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');