Skip to content

Instantly share code, notes, and snippets.

View rexmac's full-sized avatar

Rex McConnell rexmac

View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 8, 2024 10:22
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.
@javan
javan / optimized-screenshots.md
Created July 8, 2019 18:51
macOS: Optimized Screenshots
😱 Before: ~/Desktop/Screen Shot….png 4.1 MB
🏆 After: ~/Screenshots/Screen Shot….png 937 KB

  ⤵

  1. Install https://pngquant.org/
    $ brew install pngquant
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 6, 2024 20:05
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).