This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"foreground": "#01F0FF", | |
"style": "plain", | |
"template": " {{ .UserName }} ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const unitRateInfo = { | |
andhrapradesh: [ | |
{ | |
minUnit: 1, | |
maxUnit: 30, | |
totalUnit: 30, | |
rate: 1.9, | |
maxCost: 57, | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"title": "Book 1", | |
"author": ["Author 1", "Author 2"], | |
"genre": "Mystery", | |
"publicationYear": 2020, | |
"publisher": { "name": "Publisher A", "location": "City A" }, | |
"reviews": [ | |
{ "user": "User 1", "comment": "Great book!" }, | |
{ "user": "User 2", "comment": "Interesting plot" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const district = 'barisal'; | |
const customerCategory = 'residential'; | |
const averageElectricityConsumptionCost = 1800; // tk | |
const unitInfo = { | |
barisal: { | |
residential: [ | |
{ | |
min: 0, | |
max: 50, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Merging two arrays of objects | |
// if the object is same in both arrays, then update the quantity else add the object to the new merged array array | |
const arr1 = [ | |
// from db | |
{ name: 'orange', qty: 5, vendor_details: { name: 'akash', vendor_id: 8 } }, | |
{ name: 'apple', qty: 10, vendor_details: { name: 'akash', vendor_id: 8 } }, | |
{ name: 'mango', qty: 15, vendor_details: { name: 'akash', vendor_id: 8 } }, | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const array = [ | |
['a', ['m', 'n', 'o']], | |
['b', ['s', 't', 'u']], | |
['d', ['e', 'f', 'g']], | |
] | |
function getShortestPath(target, array){ | |
let shortest = array[0]; | |
let shortestDistance = Infinity; | |
for(let i = 0; i < array.length; i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const textToSpeech = (text) => { | |
const speech = new SpeechSynthesisUtterance(text); | |
[speech.voice] = speechSynthesis.getVoices(); | |
// sp.rate = ?; //speed of the voice. Default value is 1. lowest = 0.1 and highest = 10 | |
// sp.pitch = ?; //pitch of the voice. Default value is 1. lowest = 0 and highest = 2 | |
speechSynthesis.speak(speech); | |
}; | |
textToSpeech('Hello TalkJS!'); |