Skip to content

Instantly share code, notes, and snippets.

View samoshkin's full-sized avatar

Alexey Samoshkin samoshkin

View GitHub Profile
@samoshkin
samoshkin / tech_lead_role.md
Last active May 14, 2025 08:26
Tech Lead role and responsibilities

What I mean by "Tech Lead" role and responsibilities

  1. It's the person who is responsible for the technical quality of the project. For example, the Team agrees to adhere to a particular level of quality (e.g no linter errors, no failing tests, naming conventions, Git branching model, release cycles, modular structure, software design practices and principles). The Tech Lead is the person who detects violations of our quality policy, communicates it to team members, and explains what should be improved.

  2. Tech Lead has a high-level vision of the project architecture, and also aware of low-level details and nuances, by being involved in everyday development activities.

  3. Tech lead spends 80% of his time in development activities. Otherwise, he will lose the technical feeling of the project, and become a "Сферический конь в вакууме". In the same way, Tech Lead is not limited only to tech debt or infrastructure-related tasks, he works on regular product

@samoshkin
samoshkin / text_vs_binary_protocols.md
Last active February 16, 2024 02:16
Comparison of text and binary protocols

Text protocols

In plain text protocols, the bit stream is organised as a sequence of characters or text strings, e.g. Unicode or ASCII. So the two computers are exchanging textual messages. Example: number 20020 is represented by five characters (5 bytes).

Pros and cons:

  • interoperability between multiple platforms and runtimes that adhere to open and well-known standards: JSON, XML.
  • results in larger size messages
  • can be easily, inspected, read, debugged
@samoshkin
samoshkin / async_generator_to_observable.ts
Created March 1, 2020 18:37
Create Observable from async generator
this.obs = createFrom(async function *() {
await delay(1000);
yield 1;
yield 2;
await delay(500);
await delay(300);
yield 3;
await delay(400);
yield 4;
yield 5;
type Operator<TSource, TTarget> = (source: Observable<TSource>) => Observable<TTarget>;
function pipe(this: Observable<any>, ...operators: Operator<any, any>[]): Observable<any> {
return operators.reduce((acc, curr) => curr(acc), this);
}
// replace native pipe() method
Observable.prototype.pipe = pipe;
function map<TSource, TTarget>(transform: (TSource) => TTarget): Operator<TSource, TTarget> {
@samoshkin
samoshkin / prose.md
Created February 27, 2020 17:36
Angular DI и Forms. О чем вам не расскажут книги.

Например есть такая задача. Есть компонент, и на него же вешается директива.

<input [formControl]="controller.formControl"></input>

где component - в данном случае это родной [formControl] - это директива

Задача директивы это настроить связку между "input.value" (view) и controller.formControl (model) в две стороны:

@samoshkin
samoshkin / vimrc-merge.vim
Created May 7, 2019 17:02
Test vimrc configuration to turn Vim into a mergetool
set nocompatible
filetype plugin indent on
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
set number
set hidden
set splitbelow
set splitright
@samoshkin
samoshkin / difftool_vimrc.vim
Created April 30, 2019 19:29
Test vimrc configuration to turn Vim into a difftool
set nocompatible
filetype plugin indent on
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
set number
set hidden
set splitbelow
set splitright
@samoshkin
samoshkin / env.sh
Created April 18, 2019 22:36
fzf configuration snippet
# Exclude those directories even if not listed in .gitignore, or if .gitignore is missing
FD_OPTIONS="--follow --exclude .git --exclude node_modules"
# Change behavior of fzf dialogue
export FZF_DEFAULT_OPTS="--no-mouse --height 50% -1 --reverse --multi --inline-info --preview='[[ \$(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat --style=numbers --color=always {} || cat {}) 2> /dev/null | head -300' --preview-window='right:hidden:wrap' --bind='f3:execute(bat --style=numbers {} || less -f {}),f2:toggle-preview,ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-a:select-all+accept,ctrl-y:execute-silent(echo {+} | pbcopy)'"
# Change find backend
# Use 'git ls-files' when inside GIT repo, or fd otherwise
export FZF_DEFAULT_COMMAND="git ls-files --cached --others --exclude-standard | fd --type f --type l $FD_OPTIONS"
@samoshkin
samoshkin / convert2voice.sh
Last active September 12, 2023 06:44
Google Text-to-Speech API example
#!/bin/bash
text=$(cat -)
request="{
'input':{
'ssml':'<speak>$text</speak>'
},
'voice':{
'languageCode':'en-gb',
'name':'en-GB-Wavenet-D',