Skip to content

Instantly share code, notes, and snippets.

View everget's full-sized avatar
🎯
Focusing

Alex Orekhov everget

🎯
Focusing
View GitHub Profile
@everget
everget / clean_code.md
Created December 20, 2024 18:29 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@everget
everget / git-command-workflow-sequence-diagram.md
Last active December 18, 2024 15:24
A detailed Mermaid sequence diagram illustrating the complete Git workflow, showcasing command interactions across local and remote repositories, including setup, branching, staging, committing, pushing, pulling, and various advanced Git operations.

Git Command Workflow Sequence Diagram

%% https://mermaid.js.org/syntax/sequenceDiagram.html#styling
%% It would be cool to add sequences to the top from the column names
%%{
  init: {
	"theme": "base",
	"sequence": {
	  "actorFontFamily": "monospace",

Real-world App & Preferred Database

Real-World Application Type Preferred Main Database Reasoning
Blockchain Analytics PostgreSQL Requires strong ACID properties for integrity and detailed relational queries for analysis.
Chat/Messaging Application MongoDB Flexible schema for fast-changing message formats, handles high volumes of small, write-heavy data.
Content Management System (CMS) MongoDB Supports complex, nested document storage; handles unstructured or se
@everget
everget / pros_and_cons_of_default_exports.md
Last active December 18, 2024 15:28
Pros and Cons of JS default exports

Pros of Default Exports:

  1. Simple Syntax for Single Exports:

    • For files that export only one function, class, or object, default exports offer a simple and concise syntax: export default MyClass or export default myFunction().
    • This allows direct, clean import statements: import MyClass from './MyClass', reducing verbosity when working with a single, obvious export.
  2. Convenient for Dynamic Imports:

    • Default exports integrate relatively cleanly with import() for dynamic imports, although there are naming challenges (see cons).

Cons and Downsides of Default Exports:

@everget
everget / software_licenses_overview.md
Last active December 18, 2024 15:25
Software Licenses Overview
License Permissions Consequences Features Use Cases
Apache License 2.0 Allows commercial use, modification, distribution, patent use, private use Must include license and copyright notice, state changes Patent license, trademark use prohibited Large-scale, commercial software projects
GNU GPL v3.0 Allows commercial use, modification, distribution, patent use, private use Must disclose source, include license and copyright notice, state changes, same license Strong copyleft, patent license, anti-circumvention provision Free software projects, ensuring derivative works remain open source
MIT License Allows commercial use, modification, distribution, private use Must include license and copyright notice Very permissive, short and simple Small projects, libraries, or any software where you want minimal restrictions
BSD 2-Clause Allows commercial use, modification, distribution, private use Must in
@everget
everget / tokens.md
Created September 26, 2023 13:21 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов

defaults:

  • npm config set init-author-name ""
  • npm config set init-author-url ""
  • npm config set init-author-email ""
  • npm config set init-license "ISC"
  • npm config set init-version "1.0.0"

custom (example)

  • npm config set init-author-name "Tierney Cyren"
  • npm config set init-author-url "https://bnb.im"
@everget
everget / js_feature_detection.md
Last active December 18, 2024 15:27
Summary of JavaScript feature detection techniques

Member in object

Check whether a certain method or property (typically an entry point into using the API or other feature you are detecting for) exists in its parent Object

Check if a certain property exists on a global object (such as window or navigator)

if("geolocation" in navigator) { ... }
@everget
everget / javascript_operator_precedence.md
Last active December 18, 2024 15:40
JavaScript Operator Precedence
Value Operator Description Example
19 ( ) Expression grouping (3 + 4)
18 . Member person.name
18 [] Member person["name"]
17 () Function call myFunction()
17 new Create new Date()
16 ++ Postfix Increment i++
16 -- Postfix Decrement i--
15 ++ Prefix Increment ++i
@everget
everget / ArrayScript.js
Last active October 12, 2024 17:31
The new look at scripting process...
// ArrayScript...or as I would have nothing to do
let testSuite = [
'Awesome',
'epic fail',
'remember,remember',
'to be or not to be...',
'DealerPoint is awesome...',
'The best code is the one that doesn`t exist...',
'Whatever the mind can conceive and believe, the mind can achieve. — Napoleon Hill',