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 / js_bitwise_hacks.md
Last active December 18, 2024 15:42
A comprehensive guide to advanced bitwise manipulation techniques in JavaScript, featuring concise code snippets demonstrating clever bit-level operations for solving various programming challenges.
@everget
everget / grouping-css-props.md
Last active January 12, 2017 16:51
CSS Properties grouping order

CSS Properties grouping order

The useful technique for CSS styling... This technique eliminates the need to spend your time for searching properties in alphabethical order

Why?

  • CSS-properties are composed by the role each of them provides, not in alphabethical order (famous wrong practices);

  • You haven't to waste your time finding CSS property in an alphabethical garbage;

  • So, your eyes don't work a needless job.

@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',
@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 / 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) { ... }

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 / 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

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@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 / 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:

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