Skip to content

Instantly share code, notes, and snippets.

View PrashantSinghGour's full-sized avatar
💭
I may be slow to respond.

Prashant Singh Gour PrashantSinghGour

💭
I may be slow to respond.
View GitHub Profile
@PrashantSinghGour
PrashantSinghGour / petrolDiesel.json
Created April 1, 2024 09:47
dummy data for api
[
{ "quarter": "Q1", "petrol": 90, "diesel": 100 },
{ "quarter": "Q2", "petrol": 150, "diesel": 130 },
{ "quarter": "Q3", "petrol": 280, "diesel": 220 },
{ "quarter": "Q4", "petrol": 600, "diesel": 300 }
]
@PrashantSinghGour
PrashantSinghGour / masterSubscription.ts
Created August 17, 2023 10:53
master subscription
import { Injectable, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs';
@Injectable() // Adding the @Injectable decorator
export class SubscriptionMaster implements OnDestroy {
private subs: Subscription = new Subscription();
ngOnDestroy(): void {
this.subs.unsubscribe();
}
@PrashantSinghGour
PrashantSinghGour / .prettierrc
Created May 30, 2023 05:18
Prettier config
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
{
"version": "0.32"
}
@PrashantSinghGour
PrashantSinghGour / HTML5.md
Created December 10, 2022 08:32
Newly included features in HTML5.

HTML5

One can identify if the file is html or html5 if on the top of the html tag. there is a below declaration.

<!DOCTYPE html>

Earlier in HTML there was not media implementaion, HTML5 introduced media tags such as <video>, <audio>, <object>.

@PrashantSinghGour
PrashantSinghGour / 1.js
Created February 24, 2021 18:25 — forked from getify/1.js
Converting English number sentences ("one hundred forty two point three") to numeric digits ("142.3")
convert("one hundred five"); // "105"
convert("six hundred and fifty three"); // "653"
convert("zero zero one two three"); // "123"
convert("twelve o three"); // "1203"
convert("thirteen zero nine"); // "1309"
convert("fifteen sixteen"); // "1516"
convert("fourteen ninety two"); // "1492"
convert("nineteen ten"); // "1910"
convert("twenty twenty"); // "2020" <---- ugh!
convert("twenty twenty one"); // "2021" <---- ehhh...