Skip to content

Instantly share code, notes, and snippets.

View kembek's full-sized avatar

Beknazar kembek

  • Bishkek, Kyrgyzstan
View GitHub Profile
@kembek
kembek / .gitlab-ci.node-cache.yml
Last active June 15, 2023 08:32
GitLab configurations
# global cache settings
cache:
# create a key
- key: &global_cache_node_mods
files:
- package-lock.json
paths:
- node_modules/
# prevent subsequent jobs from modifying cache
policy: pull
@kembek
kembek / multiple_ssh_setting.md
Created February 28, 2021 15:52 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@kembek
kembek / ErrorFocus.jsx
Created January 24, 2021 16:56 — forked from dphrag/ErrorFocus.jsx
Formik Scroll To First Invalid Element W/O Refs
import React from 'react';
import { connect } from 'formik';
class ErrorFocus extends React.Component {
componentDidUpdate(prevProps) {
const { isSubmitting, isValidating, errors } = prevProps.formik;
const keys = Object.keys(errors);
if (keys.length > 0 && isSubmitting && !isValidating) {
const selector = `[id="${keys[0]}"]`;
const errorElement = document.querySelector(selector);
@kembek
kembek / .eslintignore
Last active January 24, 2021 13:11
ESLint
node_modules/
.eslintrc.js
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".
@kembek
kembek / mansory.css
Created September 25, 2020 19:13
Mansory layout css
.masonry {
display: flex;
width: 100%;
}
.masonry--h {
flex-flow: row wrap;
}
.masonry--v {
@kembek
kembek / ga-un-obfusticated.js
Created August 29, 2020 11:48 — forked from jenyayel/ga-un-obfusticated.js
Un-obfusticated Google Analytics with comments
(
/**
* @param {object} window - Reference to window object to make method shorter.
* @param {object} document - Reference to the element that will contain the script tag and to make method shorter.
* @param {string} scriptTagName - Contains the word 'script' to make method shorter.
* @param {string} scriptAddress - The address of the main script that we need to load.
* @param {string} globalName - This allows dynamically define global variable name to avoid conflicts with other SDKs.
* @param {object} scriptElement - Stores the element that will be created later (result variable to avoid declaration within the method body)
* @param {object} otherScriptElement - The script tag that already located in the body before which we'll inject a newly created script tag (result variable to avoid declaration within the method body)
*/
@kembek
kembek / wdio.conf.ts
Last active February 4, 2022 01:04
E2E test configurations
// tslint:disable
/// <reference path="./node_modules/@wdio/sync/webdriverio.d.ts" />
/// <reference path="./node_modules/@wdio/sync/webdriverio-core.d.ts" />
const merge = require('lodash/merge');
const { TimelineService } = require('wdio-timeline-reporter/timeline-service');
interface JasmineNodeOpts {
defaultTimeoutInterval?: number;
requires?: string[];
expectationResultHandler?: (passed: any, assertion: any) => void;
@kembek
kembek / launch.advanced.json
Last active July 23, 2020 09:37
VSCode configuration
{
"version": "0.2.0",
"inputs": [
{
"type": "pickString",
"id": "project",
"default": "crm",
"description": "The project name",
"options": ["crm", "auth"]
},
@kembek
kembek / getRandomInt.js
Last active June 17, 2020 16:30
Utils functions
export function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}