Skip to content

Instantly share code, notes, and snippets.

View kinda-neat's full-sized avatar
🎯
Focusing

Maxim Lamonov kinda-neat

🎯
Focusing
View GitHub Profile
@kinda-neat
kinda-neat / call-yourself-a-senior-prove-it.md
Last active October 13, 2023 13:15
I don't care if you call yourself a senior. Prove yourself.

В целом мои мысли когда я слышу, что кто-то считает себя Senior можно выразить так: I don't care that you think you are a Senior. Show me the code. Prove yourself. Earn your stripes. Respect is earned, not given. Факт того что кто-то считает себя синьором мало о чем говорит (читайте “может вообще ни о чем не говорить / быть пустым звуком”).

Мысли по ряду моментов:

Человек думает что владеет языком X.

  • Можно считать что ты умеешь в JavaScript и в итоге писать на нем как ты писал в C#, не понимая примитивы, специфику языка (functions as first-class citizens, etc.), специфику платформы, апи платформы, флоу исполнения кода (как интерпретатор исполняет код). В лучшем случае это “натягивание одного языка на другой”, в худшем случае это неуместное использование либ типа deasync.
  • Можно считать что ты умеешь в TypeScript и на практике иметь пол кодовой базы в any (все что сложнее базовых string, number, array, etc.). Про понимание дженериков вообще молчу.
  • Не пони
@kinda-neat
kinda-neat / ubiquitous-ideas.md
Last active October 13, 2023 13:16
Ubiquitous ideas that underpin code I write | Идеи пронизывающие мою работу

Здесь хочу положить в текст идеи которые пронизывают мою работу, код который я пишу, ревью которые провожу, куда я тяну кодовые базы над которыми работаю. Нумерация не означает важность/приоритетность, важно всё.

Зачем это всё? Центральный аспект - чтобы кодовая база была и оставалась поддерживаемой.

cost_maintain

@kinda-neat
kinda-neat / client-or-server-side-form-validation.md
Last active October 24, 2023 15:34
Where should you do form validation: on Backend, Frontend or both? And Why?

This note is the result of research on where and why you should do form validations: on Backend, Frontend or both.

The best summary you can find:

The people saying to do it on both sides are correct, but there's a bit of nuance here.

You HAVE to do it on the back end for security purposes. That's really the key consideration. You can't ever trust what's coming from the client. Period, end of story. It can ALWAYS be hacked, that's how you have to treat it.

@kinda-neat
kinda-neat / how-long-did-you-think-about-useLayoutEffect.md
Last active March 12, 2024 11:29
Уверены что понимаете как работает useLayoutEffect?

В доке по useLayoutEffect можно найти следующие отрывки:

  • React guarantees that the code inside useLayoutEffect and any state updates scheduled inside it will be processed before the browser repaints the screen.
  • Call useLayoutEffect perform the layout measurements before the browser repaints the screen:
  • The code inside useLayoutEffect and all state updates scheduled from it block the browser from repainting the screen. When used excessively, this makes your app slow. When possible, prefer useEffect.

Как это возможно? Как Реакт может гарантировать что код внутри useLayoutEffect и стейт апдейты запланированные внутри него будут выполнены до перерисовки экрана браузером? Как Реакт может влиять на перерисовку браузером, как может ее блокировать? Как Реакт это делает и как вы

@kinda-neat
kinda-neat / closures-objects.js
Last active August 3, 2021 15:59
Closures are poor man's objects and vice versa
function makeCounter(initial) {
let counter = initial || 0;
return {
inc: () => { counter += 1; },
dec: () => { counter -= 1; },
reset: () => { counter = initial || 0; }
}
}
@kinda-neat
kinda-neat / React hooks mental model.txt
Last active August 29, 2020 16:09
React hooks mental model
https://twitter.com/tylermcginnis/status/1169667360795459584
useState: Persist value between renders, trigger re-render
useRef: Persist value between renders, no re-render
useEffect: Side effects that run after render
useReducer: useState in reducer pattern
useMemo: Memoize value between renders
useCB: Persist ref equality between renders
@kinda-neat
kinda-neat / ThreeLayerCake.hs
Last active July 4, 2020 04:12
ThreeLayerCake
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FunctionalDependencies #-}
module Bot
( runMeInMain
) where