Skip to content

Instantly share code, notes, and snippets.

View galkin's full-sized avatar
🇺🇦

Nikita Galkin galkin

🇺🇦
View GitHub Profile
@galkin
galkin / AuthyToOtherAuthenticator.md
Created April 26, 2024 16:33 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@galkin
galkin / Readme.md
Created August 22, 2022 14:01
JavaScript Loop Benchmark

JavaScript Loop Benchmark

In this benchmark we will compare for(const el of array) vs for(let i = 0; i < array.length; i++). For that we will use hyperfine.

Benchmarks Environment

  • Node.js v16.16.0
  • MacBook Pro (16-inch, 2021) with Apple M1 Pro and 16 GB Memory

Case 1: Empty loop

@galkin
galkin / Output
Created July 19, 2022 15:37
Example for demonstration request count limit with big event loop deleay
➜ ~ ab -c 20 -n 1000 http://localhost:3000/ ([email protected]:formelife-develop)(gke_formelife-develop_us-central1_cluster-develop/default)
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
import { CallHandler, ExecutionContext, HttpException, InternalServerErrorException, NestInterceptor } from '@nestjs/common';
import { Request, Response } from 'express';
import type { Level } from 'pino';
import { Observable, throwError } from 'rxjs';
import { catchError, tap } from 'rxjs/operators';
import logger from '~/logger';
import { setRequestContext } from '~/shared/common/request-context';
export class AppInterceptor implements NestInterceptor {
@galkin
galkin / git-done
Created October 12, 2019 12:14
Example git-done
#!/usr/bin/env bash
DEFAULT_BRANCH=master
CURRENT_BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
git checkout ${DEFAULT_BRANCH}
git pull
git branch -D ${CURRENT_BRANCH}
open https://jira.gamaya.com:8443/browse/${CURRENT_BRANCH}
@galkin
galkin / Readme.md
Last active May 25, 2019 13:48
Skip broken tslint rules

Usage

Pass the URL for this gist to npx in the project folder

Precondition:

  • tslint is installed
  • tslint.json exist
  • tsconfig.json exist
@galkin
galkin / Readme.md
Last active March 24, 2018 16:46
Skip broken eslint rules

Usage

Pass the URL for this gist to npx in the project folder

Precondition:

  • eslint is installed
  • .eslintrc.json exist