Skip to content

Instantly share code, notes, and snippets.

View samoshkin's full-sized avatar

Alexey Samoshkin samoshkin

View GitHub Profile
@samoshkin
samoshkin / postman_vs_insomnia_comparison.md
Created November 6, 2018 17:42
Comparison of API development environments: Postman vs Insomnia

Postman vs Insomnia comparison

Postman | API Development Environment https://www.getpostman.com
Insomnia REST Client - https://insomnia.rest/

Features                                        Insomnia Postman Notes
Create and send HTTP requests x x
Authorization header helpers x x Can create "Authorization" header for you for different authentication schemes: Basic, Digest, OAuth, Bearer Token, HAWK, AWS
@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 / toggle_keybindings.tmux.conf
Last active February 5, 2024 02:26
tmux.conf excerpt to toggle on/off session keybindings and prefix handling
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
@samoshkin
samoshkin / tech_lead_role.md
Last active October 31, 2023 10:09
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 / 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;
@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',
@samoshkin
samoshkin / jira_ticket_status_diagram_in_mermaid.mmd
Created August 28, 2021 06:30
JIRA ticket state diagram written in Mermaid DSL
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@samoshkin
samoshkin / socket-io-and-redux-saga-integration.js
Last active September 12, 2023 06:32
Socket.IO and redux-saga integration. Connection management
import { io } from 'socket.io-client';
import * as SentrySDK from '@sentry/react';
import {
call,
fork,
takeEvery,
put,
race,
take,
} from 'redux-saga/effects';
@samoshkin
samoshkin / index.sql
Last active August 31, 2023 12:15
Query index properties in PosgreSQL: "hash" index
/*
===================
INDEX PROPERTIES
===================
*/
/*
NOTE: In this example, we explore "hash" index properties using PostgreSQL system catalog tables
*/
@samoshkin
samoshkin / index.md
Created April 5, 2023 20:02
Statements about Python

Statements describing Python as a language

Interpreted: Python is an interpreted language, which means that the source code is translated and executed line-by-line at runtime, rather than being compiled to machine code beforehand.

Dynamic type system: Python uses a dynamic type system, which means that variable types are determined at runtime and can change during the execution of a program.

Garbage-collected: Python automatically manages memory allocation and deallocation using garbage collection, which frees developers from having to manually manage memory in their code.

Indentation-based syntax: Python uses indentation to define code blocks, making the code more readable and less cluttered with braces or other delimiters.