Skip to content

Instantly share code, notes, and snippets.

View BorisTB's full-sized avatar
🦠
vibin'

Boris BorisTB

🦠
vibin'
  • Prague, Czech Republic
View GitHub Profile
@ef4
ef4 / examples.md
Last active January 29, 2025 20:54
Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 4 automatically polyfilled many Node APIs in the browser. This was not a great system, because it could lead to surprisingly giant libraries getting pulled into your app by accident, and it gave you no control over the exact versions of the polyfills you were using.

So Webpack 5 removed this functionality. That means you need to make changes if you were relying on those polyfills. This is a quick reference for how to replace the most common patterns.

List of polyfill packages that were used in webpack 4

For each automatically-polyfilled node package name on the left, this shows the name of the NPM package that was used to polyfill it on the right. Under webpack 5 you can manually install these packages and use them via resolve.fallback.

@trungvose
trungvose / nx-structure-angular-nestjs.md
Last active March 29, 2025 06:58
Nx workspace structure for NestJS and Angular

Nx

https://nx.dev/

Nx is a suite of powerful, extensible dev tools to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, caching, dependency management, and more.

It has first-class support for many frontend and backend technologies, so its documentation comes in multiple flavours.

Principles

@rdeak
rdeak / docker-compose.yml
Created February 19, 2021 20:21
List of popular server images
version: '2.4'
volumes:
esdata:
driver: local
networks:
backend:
driver: bridge
@siakaramalegos
siakaramalegos / prettier.md
Last active January 24, 2025 13:59
Adding Prettier to a project

Adding Prettier to a Project

Basic steps for adding Prettier to a project and setting up a pre-commit hook when not using any other linter. Most of these steps can be found in the docs and through other links in the docs.

  1. Install prettier:
$ npm install --save-dev --save-exact prettier
  1. Create an empty config file to let tools know you're using Prettier:
@colinhacks
colinhacks / _document.tsx
Last active January 12, 2023 16:44
How to support server-side rendering for plain "emotion" package in Next.js
// ⚠️ works with Emotion 10 only! ⚠️
// 1. `yarn add emotion-server`
// 2. copy the contents of this file into your `pages` directory
// 3. save it as `_document.tsx`
// should work out of the box
import Document, { Head, Main, NextScript } from 'next/document';
@ww9
ww9 / one-line-text-art-and-emojis_utf8_ascii.txt
Last active March 26, 2025 11:47
Emojis, UTF8, ASCII (one line) #misc
# Collection of one line text art (◕‿◕✿)
Collection of emojis and one line text art like (╯°□°)╯︵ ┻━┻ 🤗
ּבּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active March 7, 2025 20:19
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@bcoe
bcoe / npm-top.md
Last active March 21, 2025 03:49
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads
@peteroupc
peteroupc / LineReader.js
Last active August 17, 2024 10:43
JavaScript class for reading files line by line in HTML5 apps
/*
Written by Peter O.
Any copyright to this work is released to the Public Domain.
In case this is not possible, this work is also
licensed under Creative Commons Zero (CC0):
https://creativecommons.org/publicdomain/zero/1.0/
*/