Tech_Dev

Tech_Dev

Share

24/10/2024

🚀 Excited to announce my latest web app: Mister Faster Repairs, built specifically for device repair shops using the MERN stack! 🎉

Say goodbye to sticky notes and hello to streamlined task management. Here’s what Mister Faster Repairs offers:

🔧 Key Features: 1️⃣ Replaces sticky note systems with a modern, digital solution. 2️⃣ Public-facing page with essential contact info. 3️⃣ Secure employee login with a personalized welcome page. 4️⃣ Easy-to-use navigation, displaying the logged-in user and role. 5️⃣ Weekly login requirement and a quick logout option for security. 6️⃣ Manage user access in real-time when necessary. 7️⃣ Ticketing system for notes with statuses: OPEN or COMPLETED. 8️⃣ Role-based permissions: Employees, Managers, Admins. 9️⃣ Employees can only view/edit their assigned notes, while Managers and Admins can manage all. 🔟 Only Managers/Admins can create new users and modify settings. 1️⃣1️⃣ Fully responsive for access on any device.

Whether it's creating new tasks, assigning notes, or managing staff access, Mister Faster Repairs simplifies it all! 💼🔑

Built using the MERN stack (MongoDB, Express, React, Node.js), this app provides a robust solution to improve workflow and organization in device repair shops.

Check it out and let me know what you think! 💻⚡

https://misterfasterrepairs.onrender.com
for testing purposes use the following usernames and passwords:
username: password
employee employee1234
manager manager1234
admin admin1234

Vite + React

26/01/2023

JavaScript Intermediate Algorithm Scripting
Algorithm: Convert HTML Entities

function convertHTML(str) {
let singleQuote = /'/;
let doubleQuote = /"/;
for (let i=0; i< str.length; i+=1) {
if (str[i] === "&") {
str = str.indexOf(str[i]) != -1
? str.replace(str[i], "&"): str;
} else if (str[i] === "") {
str = str.indexOf(str[i]) != -1
?str.replace(str[i], ">"): str;
} else if (singleQuote.test(str[i])===true) {
str = str.replace(singleQuote, "'");
} else if (doubleQuote.test(str[i])===true) {
str = str.replace(doubleQuote, """);
}
}
return str;
}
console.log(convertHTML("Dolce & Gabbana"));
Tests :
Passed:
convertHTML("Dolce & Gabbana");
should return the string Dolce & Gabbana.
Passed:
convertHTML("Hamburgers < Pizza < Tacos");
should return the string Hamburgers < Pizza < Tacos.
Passed:
convertHTML("Sixty > twelve");
should return the string Sixty > twelve.
Passed:
convertHTML('Stuff in "quotation marks"');
should return the string Stuff in "quotation marks".
Passed:
convertHTML("Schindler's List");
should return the string Schindler's List.
Passed:
convertHTML("");
should return the string <>.
Passed:
convertHTML("abc");
should return the string abc.

24/01/2023

Sorted Union JavaScript Algorithem

Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.

In other words, all values present from all arrays should be included in their original order, but with no duplicates in the final array.

The unique numbers should be sorted by their original order, but the final array should not be sorted in numerical order.

Check the assertion tests for examples.

function uniteUnique(arr) {
let array = [];
for (let i=0; i< arguments.length; i+=1) {
for (let j=0; j< arguments[i].length; j+=1) {
if (array.indexOf(arguments[i][j])== -1) {
array.push(arguments[i][j]);
}
}
}
return array;
}

Tests that needs to be passed are in the following.

Passed:
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
should return [1, 3, 2, 5, 4].

Passed:
uniteUnique([1, 2, 3], [5, 2, 1]) ;
should return [1, 2, 3, 5]

Passed:
uniteUnique([1, 2, 3], [5, 2, 1, 4], [2, 1], [6, 7, 8]);
should return [1, 2, 3, 5, 4, 6, 7, 8].

Passed:
uniteUnique([1, 3, 2], [5, 4], [5, 6]);
should return [1, 3, 2, 5, 4, 6].

Passed:
uniteUnique([1, 3, 2, 3], [5, 2, 1, 4], [2, 1]);
should return [1, 3, 2, 5, 4].

15/01/2023

DNA Pairing

Pairs of DNA strands consist of nucleobase pairs. Base pairs are represented by the characters AT and CG, which form building blocks of the DNA double helix.

The DNA strand is missing the pairing element. Write a function to match the missing base pairs for the provided DNA strand. For each character in the provided string, find the base pair character. Return the results as a 2d array.

For example, for the input GCG, return [["G", "C"], ["C","G"], ["G", "C"]]

The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.

This is my own solution.

function pairElement(str) {
let singleDNa = str.split("");
let dNAPair = [];
for (let i=0; i< singleDNa.length; i+=1) {
if (singleDNa[i]=== "A") {
dNAPair.push(["A", "T"]);
} else if (singleDNa[i] === "T") {
dNAPair.push(["T", "A"]);
} else if (singleDNa[i] === "C") {
dNAPair.push(["C", "G"]);
} else if (singleDNa[i] === "G") {
dNAPair.push(["G", "C"]);
}
}

return dNAPair;
}

These tests should pass:

Passed:
pairElement("ATCGA");
should return [["A","T"],["T","A"],["C","G"],["G","C"],["A","T"]].

Passed:
pairElement("TTGAG");
should return [["T","A"],["T","A"],["G","C"],["A","T"],["G","C"]].

Passed:
pairElement("CTCTA");
should return [["C","G"],["T","A"],["C","G"],["T","A"],["A","T"]].

19/02/2022

Append to an element
//first get the element from HTML DOM which would be the parent element.
let parent = document.querySelector('parent');

//create the child element with JavaScript as shown below
let child = document.createElement('div');

//append the child element as shown below
JS code-->: parent.appendChild(ele);

19/02/2022

Add class to an element in JavaScript

ele.classList.add('class-name');

// Add multiple classes (Not supported in IE 11)


let ele = document.querySelector('.element');
code -->: ele.classList.add('another', 'class', 'name');
----------------------------------------------------------

Remove a class from an element in JavaScript
//Note that multiple parameters for the remove() aren't
//supported in IE 11.

// Remove multiple classes (Not supported in IE 11)
code -->: ele.classList.remove('another', 'class', 'name');

Want your business to be the top-listed Advertising & Marketing Company in Gurugram?
Click here to claim your Sponsored Listing.

Category

Telephone

Address


Gurugram
Gurugram
122505