This file contains hidden or 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
| import axios from "axios"; | |
| import React, { useCallback, useState } from "react"; | |
| const FirstComponent = () => { | |
| const [suggestions, setSuggestions] = useState(""); | |
| const debounce = (func) => { | |
| let timer; | |
| return function (...args) { | |
| const context = this; |
This file contains hidden or 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
| /** | |
| * @param {*} data | |
| * return the data in the format of excel | |
| * import moment as moment-timezone, to install the moment-timezone use this link - https://www.npmjs.com/package/moment-timezone | |
| */ | |
| getCurrentTimezoneDate(date) { | |
| return moment | |
| .tz(date, Intl.DateTimeFormat().resolvedOptions().timeZone) | |
| .format("MM/DD/YYYY hh:mmA"); | |
| } |
This file contains hidden or 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
| 1. Docker command version - docker --version | |
| 2. To run a container - docker run <container_name> | |
| 3. To check running container lists - docker ps | |
| 4. To create a new container - docker create -it <container_name> /bin/bash | |
| 5. To start and attach STDIN (output in console) - docker start -ai <container_id> | |
| 6. To list all docker images - docker images | |
| 7. To check the status of all containers - docker ps -a | |
| 8. To remove all unused images - docker image prune | |
| 9. To run container in detach mode - docker run -it -d <container_name> | |
| 10. To stop the container - docker stop <container_id> |
This file contains hidden or 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
| /** | |
| * to fetch particular key and value from an array | |
| */ | |
| function pluck(array, key) { | |
| return array.map(function (item) { | |
| return item[key]; | |
| }); | |
| } |
This file contains hidden or 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
| // ts file | |
| import { Component } from '@angular/core'; | |
| import { Options } from 'ngx-google-places-autocomplete/objects/options/options'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.css'], | |
| }) | |
| export class AppComponent { |
This file contains hidden or 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
| /** | |
| * | |
| * @param {*} array | |
| * @param {*} key | |
| * @param {*} rowOrderBy | |
| * @param {*} type | |
| * @returns | |
| */ | |
| const sortTableData = (array, key, rowOrderBy, type) => { | |
| let _key = key; |
This file contains hidden or 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
| /** | |
| * | |
| * @param {*} date | |
| * @param {*} days | |
| * @returns | |
| */ | |
| addWeekDays(date, days) { | |
| let daysToAdd = days; | |
| const today = moment(date); | |
| const nextWeekStart = today.clone().add(1, "week").weekday(1); |
This file contains hidden or 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
| import commonUtils from "./commonUtils"; | |
| import { errorReuiredMessage, errorValidationMessage } from "./errorMessages"; | |
| import regexUtils from "./regexUtils"; | |
| /** | |
| * event handler to check reuired error | |
| * @param {*} form | |
| * @returns error object for error and class | |
| */ | |
| export const validationErrorUtils = (form) => { |
This file contains hidden or 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
| printOrder = (order) => { | |
| const input = document.getElementById("printableBox"); | |
| html2canvas(input, { | |
| logging: true, | |
| letterRendering: 1, | |
| allowTaint: false, | |
| useCORS: true, | |
| }).then((canvas) => { | |
| const imgData = canvas.toDataURL("image/png"); | |
| const pdf = new jsPDF(); |
This file contains hidden or 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 handlePrint = () => { | |
| let column_header = [ | |
| "Id", | |
| "Date & Time", | |
| "Valid On Date & Time", | |
| "Username & email", | |
| "Gift by", | |
| "Gift Code", | |
| "Items", | |
| "Type", |
NewerOlder