Skip to content

Instantly share code, notes, and snippets.

View AlienAmigo's full-sized avatar
💭
When in doubt make a layout!

Peter Ryzhov AlienAmigo

💭
When in doubt make a layout!
  • Saint-Petersburg, Russia
  • 02:26 (UTC +03:00)
View GitHub Profile
export const CatalogItemsData = [
{
id: "60136654-605b-4314-9d7a-edb92d31572d",
title: "Автозапчасти",
full_title: "Автозапчасти",
description: null,
parent_id: null,
children_exists: false,
children: [],
},
@AlienAmigo
AlienAmigo / WebStorm_DataGrip_IntelliJIdea
Created March 18, 2024 09:26 — forked from doxt3r/WebStorm_DataGrip_IntelliJIdea
WebStorm & DataGrip & IntelliJIdea renew license
cd ~/.WebStorm*
rm config/eval/WebStorm*evaluation.key
rm config/options/other.xml
cd ~/.java/.userPrefs/jetbrains
rm -rf webstorm
cd ~/.DataGrip*
rm config/eval/DataGrip*evaluation.key
rm config/options/other.xml
@AlienAmigo
AlienAmigo / formatDigitByClasses
Created March 4, 2024 07:20
formatDigitByClasses
const formatDigitByClasses = (
num: string | number,
separator: string = ' '
): string => {
let str = (typeof num === 'number' ? num.toString() : num).trim();
const findClassRegExp = /(\d)(\d{3}(\s\d{3})*([,.]\d+)?)$/gi;
while (str.match(findClassRegExp)) {
str = str.replace(findClassRegExp, `$1${separator}$2`);
}
return str;
const formatDigitByClasses = (
num: string | number,
separator: string = ' '
): string => {
let str = (typeof num === 'number' ? num.toString() : num).trim();
const findClassRegExp = /(\d)(\d{3}(\s\d{3})*([,.]\d+)?)$/gi;
while (str.match(findClassRegExp)) {
str = str.replace(findClassRegExp, `$1${separator}$2`);
}
return str;
enum StatusesEnum {
greenStatus = 'greenStatus',
yellowStatus = 'yellowStatus',
redStatus = 'redStatus',
}
type IDataItem = {
[key in StatusesEnum]?: boolean;
};
@AlienAmigo
AlienAmigo / .gitignore
Created February 18, 2024 18:35
gitignore for Java
# Compiled class file
*.class
**/tempCodeRunnerFile.java
# Log file
*.log
# BlueJ files
*.ctxt
@AlienAmigo
AlienAmigo / mock.ts
Last active April 27, 2024 10:07
good mock
import { nanoid } from 'nanoid';
export type CatalogItemType = {
id: string;
title: string;
items?: CatalogItemType[];
};
export const CatalogItemsData: CatalogItemType[] = [
{
id: nanoid(),
@AlienAmigo
AlienAmigo / helpful.md
Created January 17, 2024 06:36
helpful articles

Как склеить коммиты и зачем это нужно 14 июня 2023 Git https://htmlacademy.ru/blog/git/how-to-squash-commits-and-why-it-is-needed

Как подготовиться

Для некоторых операций из этой статьи Git будет открывать текстовый редактор. Во многих системах по умолчанию это Vim. Не самый дружелюбный для новичков. Чтобы вам было комфортно, установите в качестве Git-редактора ваш любимый редактор. Это делается с помощью команды:

git config --global core.editor
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
tempCodeRunnerFile.py
# C extensions
*.so
# Distribution / packaging
.Python
@AlienAmigo
AlienAmigo / jetbrains-license-3.bat
Created October 3, 2023 07:52 — forked from W1773ND/jetbrains-license-3.bat
JetBrains activation key trial reset PyCharm IntelliJ IDEA PhpStorm 2021 ALWAYS WORKS on Windows and Linux. PLEASE READ THE "thanks" FILE TOO!
cd %APPDATA%\JetBrains
del "PermanentDeviceId"
del "PermanentUserId"
rmdir "consentOptions" /s /q
cd %APPDATA%\JetBrains\PHPStorm2021.1*
rmdir "eval" /s /q
del "options\other.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains"