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 FuseScrollbars from '@fuse/core/FuseScrollbars'; | |
import Avatar from '@material-ui/core/Avatar'; | |
import Icon from '@material-ui/core/Icon'; | |
import Paper from '@material-ui/core/Paper'; | |
import { makeStyles } from '@material-ui/core/styles'; | |
import Typography from '@material-ui/core/Typography'; | |
import clsx from 'clsx'; | |
import moment from 'moment/moment'; | |
import React, { useEffect, useRef, useState } from 'react'; | |
import { useDispatch, useSelector } from 'react-redux'; |
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
function numberSigningSums(num:number =5555531):any{ | |
let arr=[...String(num)].map(x=>Number(x)) | |
if(arr.length<2){ | |
return arr[0] | |
} | |
let sum=0 | |
for(let i=0;i<arr.length;i+=2){ |
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
function insert(intervals: number[][], newInterval: number[]): number[][] { | |
let i = 0; | |
while (i < intervals.length) { | |
const [a, b] = intervals[i]; | |
const [c, d] = newInterval; | |
if ( | |
(a >= c && a <= d) || | |
(b >= c && b <= d) || | |
(c >= a && c <= b) || |
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
function arrayReplace(inputArray: number[], elemToReplace: number, substitutionElem: number): number[] { | |
let arr:number[]=[] | |
let count=inputArray.filter(x=>x===elemToReplace).length | |
if(count<1){ | |
return inputArray | |
} | |
for(let i=0;i<inputArray.length ;i++){ |
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
function sortedSquares(nums: number[]=[-4,-5,0,1,2]): number[] { | |
let left =0 | |
let right=nums.length-1; | |
let arr= new Array(nums.length).fill(0) | |
for(let i=0;i<nums.length;i++){ | |
if(Math.abs (nums[left])>Math.abs (nums[right])){ | |
arr[i]=nums[left]*nums[left] ; | |
left++ |
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 { mergeTypes, mergeResolvers } from "merge-graphql-schemas"; | |
import * as path from "path"; | |
import * as fs from "fs"; | |
import { makeExecutableSchema } from "graphql-tools"; | |
import * as glob from "glob"; | |
export const useSchema = () => { | |
const pathToModules = path.join(__dirname); | |
const graphqlTypes = glob |
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
// .eslint.js=> | |
module.exports = { | |
parser: '@typescript-eslint/parser', | |
overrides: [ | |
{ | |
files: ['*.ts', '*.tsx'], // Your TypeScript files extension | |
parserOptions: { | |
project: ['./tsconfig.json'], // Specify it only for TypeScript files | |
}, | |
} |
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 { INestApplication } from '@nestjs/common'; | |
import { DocumentBuilder, OpenAPIObject, SwaggerModule } from '@nestjs/swagger'; | |
import { SWAGGER_CONFIG } from './swagger.config'; | |
export function createDocument(app: INestApplication): OpenAPIObject { | |
const builder = new DocumentBuilder() | |
.setTitle(SWAGGER_CONFIG.title) | |
.setDescription(SWAGGER_CONFIG.description) |
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
function isOdd(l=3,r=9){ | |
let arr=[] | |
for(;l<=r;l++){ | |
if(l%2===0){ | |
continue; | |
} | |
arr.push(l) | |
} | |
return arr.map(item=>item) |
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
function areFollowingPatterns(strings: string[], patterns: string[]): boolean { | |
for (let i: number = 0; i < strings.length; i++) { | |
if (patterns.indexOf(patterns[i]) !== strings.indexOf(strings[i])) return false; | |
} | |
return true; | |
} | |
or | |
function areFollowingPatterns(strings: string[], patterns: string[]): boolean { |