Skip to content

Instantly share code, notes, and snippets.

View trickpattyFH20's full-sized avatar

Patrick trickpattyFH20

View GitHub Profile
@trickpattyFH20
trickpattyFH20 / examples.md
Created February 1, 2023 14:00 — forked from ef4/examples.md
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.

@ef4
ef4 / examples.md
Last active April 2, 2024 17:38
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.

@ovidiuch
ovidiuch / rename.js
Last active July 8, 2022 21:45
Rename camelCase files to kebab-files
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const { kebabCase } = require('lodash');
glob
.sync('**/*', { ignore: '**/{coverage,node_modules}/**' })
.forEach(filePath => {
const pathParts = filePath.split('/');
const fileName = pathParts.pop();
@rbellamy
rbellamy / loaders.js
Created November 22, 2016 17:00
webpack configuration
'use strict';
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path = require('path');
exports.tslint = {
test: /\.ts$/,
loader: 'tslint',
exclude: [
@mcandre
mcandre / apple-bluetooth-keyboard-windows-10-bootcamp.md
Created June 14, 2016 18:12
How to fix Apple Bluetooth Wireless Keyboard (Windows 10)

The driver situation with Apple Bluetooth wireless keyboards and Windows 10 is horrible, even with the latest BootCamp drivers. Fortunately, a workaround is available, if you're patient.

Pair keyboard once

  1. Turn on the keyboard.
  2. Press and hold Command + w until the keyboard light begins blinking, indicating the keyboard is ready to pair.
  3. Use Windows Bluetooth settings to pair the keyboard, entering the same code (e.g. 123456 Enter) on both internal and external keyboards.

Pairing the keyboard is very trial and error. 9/10 times, Windows will complain that the keyboard is not available for pairing. Just keep trying.

@levi
levi / riot_esports_api.md
Last active November 8, 2023 16:38
Riot LoL eSports Unofficial API Documentation
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n