import * as Mime from 'mime-types';
import { randomUUID } from 'crypto';
getFilename(
basename: string,
type: string,
id: number | string, // так то number должен быть, но хз
mime: string,
): string {Проверять метод на скрытость, можете тут: vk.com/dev/МЕТОД
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
| # открыть консоль в нужной папке, и выполнить следующий код | |
| # https://stackoverflow.com/a/17784347 | |
| for file in my_file*.js ; do mv $file ${file//my_file/script} ; done |
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 random = (length, chars) => { | |
| let mask = ""; | |
| if (chars.indexOf("a") > -1) mask += "abcdefghijklmnopqrstuvwxyz"; | |
| if (chars.indexOf("A") > -1) mask += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
| if (chars.indexOf("#") > -1) mask += "0123456789"; | |
| if (chars.indexOf("!") > -1) mask += "~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\"; | |
| let result = ""; | |
| for (let i = length; i > 0; --i) { | |
| result += mask[Math.round(Math.random() * (mask.length - 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
| const fs = require("fs"); | |
| const files = fs.readdirSync("./img"); | |
| // console.log(files); | |
| /* | |
| [ | |
| "small0.jpg", | |
| "small1.jpg", | |
| "small10.jpg", | |
| ... |
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
| // https://github.com/Lectrum/breakpoints-json | |
| const breakpoints = { | |
| "phonePortrait": { | |
| "name": "phonePortrait", | |
| "min": "320", | |
| "max": "414" | |
| }, | |
| "phoneLandscape": { | |
| "name": "phoneLandscape", |
jscpd — Обнаружение дублирования в исходном коде
Проверить код в текущей папке, игнорировать node_modules
npx jscpd . --ignore "node_modules/**/*"
-
My windows performance settings
NewerOlder
