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 messages = [ | |
{ | |
id: 1, | |
text: 'text 1', | |
userId: 1 | |
}, | |
{ | |
id: 2, | |
text: 'text 2', | |
userId: 1 |
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
import { CacheModule, Global, Module } from '@nestjs/common'; | |
import type { ClientOpts } from 'redis'; | |
import { ConfigModule, ConfigService } from '@nestjs/config'; | |
import redisStore from 'cache-manager-redis-store'; | |
@Global() | |
@Module({ | |
imports: [ | |
CacheModule.registerAsync<ClientOpts>({ | |
imports: [ConfigModule], |
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
export const PhotoPreviewExcerpt = ({ | |
file, | |
setSelectedFiles, | |
}: { | |
file: File; | |
setSelectedFiles: React.Dispatch<React.SetStateAction<File[] | null | undefined>>; | |
}) => { | |
const fileReaderRef = React.useRef<FileReader>(); | |
const [photoSrc, setPhotoSrc] = React.useState<string>(); |
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
code --install-extension analytic-signal.preview-mp4 | |
code --install-extension Angular.ng-template | |
code --install-extension apollographql.vscode-apollo | |
code --install-extension bungcip.better-toml | |
code --install-extension dbaeumer.vscode-eslint | |
code --install-extension dsznajder.es7-react-js-snippets | |
code --install-extension eamodio.gitlens | |
code --install-extension ecmel.vscode-html-css | |
code --install-extension esbenp.prettier-vscode | |
code --install-extension formulahendry.auto-rename-tag |
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
function findNumInString(str) { | |
const arrMatches = str.match(/\d+/g); | |
const num = Number(arrMatches[0]); | |
return num ? num : 0; | |
} |
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
function traverseChildren(elem, tagname) { | |
if (elem.tagName === tagname) cl(elem, elem.tagName); | |
if (!elem.children.length) return; | |
Array.from(elem.children).forEach((child) => { | |
traverseChildren(child); | |
}); | |
} |