Skip to content

Instantly share code, notes, and snippets.

View num13ru's full-sized avatar
🛠️
I may be slow to respond.

num13ru

🛠️
I may be slow to respond.
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 5, 2025 10:05
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@sebmarkbage
sebmarkbage / WhyReact.md
Created September 4, 2019 20:33
Why is React doing this?

I heard some points of criticism to how React deals with reactivity and it's focus on "purity". It's interesting because there are really two approaches evolving. There's a mutable + change tracking approach and there's an immutability + referential equality testing approach. It's difficult to mix and match them when you build new features on top. So that's why React has been pushing a bit harder on immutability lately to be able to build on top of it. Both have various tradeoffs but others are doing good research in other areas, so we've decided to focus on this direction and see where it leads us.

I did want to address a few points that I didn't see get enough consideration around the tradeoffs. So here's a small brain dump.

"Compiled output results in smaller apps" - E.g. Svelte apps start smaller but the compiler output is 3-4x larger per component than the equivalent VDOM approach. This is mostly due to the code that is usually shared in the VDOM "VM" needs to be inlined into each component. The tr

@jeanlucaslima
jeanlucaslima / Readme.md
Last active June 20, 2024 14:55
Remote Work Resources

Remote Jobs general guideline

This is something I compiled during the last weeks while job hunting. If you miss something in this list, please fork or tell me on twitter and I'll add what's missing.

  1. Be careful with jobs that are not clear they hire outside US
  2. Look for job in niches (like SaaS job boards, language-specific communities, country-focused, and so on)
  3. Avoid Upwork (pay to work, no guaranteed results, often bad contracts) and Remote.com
  4. Remote.co is not Remote.com, remote.co is ok.
  5. There are companies that hire and act as a guild, but only pay as freelancer (X-team, Gun.io, and so on)
  6. Not really focused on freelancing, as it is to me more like a one-person business
@bmaupin
bmaupin / free-database-hosting.md
Last active May 5, 2025 08:59
Free database hosting
@KRostyslav
KRostyslav / tsconfig.json
Last active May 3, 2025 13:15
tsconfig.json с комментариями.
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".
@ozio
ozio / questions.md
Last active September 28, 2021 16:55
Вопросы, которые мне задавали (или не задавали) на позицию Senior Frontend Developer (~10 их)

Я не пытался тут собрать все вопросы, которые хорошо бы задавать, а лишь те, что мне задавали (если не указано обратное), так что не неситесь жаловаться, что вы не нашли своих любимых и коварных. Так же, я не привожу список всяких логических задачек, которых, слава богу, было минимум и задачек с написанием кода на листке бумажки что, к сожалению, всё ещё распространено.

React:

  • Жизненный цикл компонента? В какой метод какие аргументы приходят? Где и как лучше обновлять стейт?
  • Что такое функциональный компонент и PureComponent? В чём разница?
  • Что такое Redux?
  • Что такое сайд-эффекты?
  • Какие бывают миддлвары в Redux?
  • Для чего нужен redux-thunk?
  • На чём построена redux-saga (на генераторах) и для чего она нужна?
@imevro
imevro / index.html
Last active March 22, 2020 19:22
Minimally working version of SSR (react, react-router, react-helmet, styled-components; implying use of react-scripts without eject)
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="$helmet-placeholder$">
<meta name="$sc-placeholder$">
<style>
@famence
famence / javascript-sorting-algorithms.js
Last active September 1, 2024 14:51
Реализация популярных алгоритмов сортировки на JavaScript с комментариями-пояснениями
// Пузырьковая сортировка
function bubbleSort(a){
var n = a.length;
for (var i = 0; i < n-1; i++){ // Выполняется для каждого элемента массива, кроме последнего.
for (var j = 0; j < n-1-i; j++){ // Для всех последующих за текущим элементов
if (a[j+1] < a[j]){ // выпоняется проверка, и если следующий элемент меньше текущего
var t = a[j+1]; a[j+1] = a[j]; a[j] = t; // то эти элементы меняются местами.
}
}
}
@matthewzring
matthewzring / markdown-text-101.md
Last active May 5, 2025 08:44
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers: