Skip to content

Instantly share code, notes, and snippets.

View grushetsky's full-sized avatar

Konstantin Grushetsky grushetsky

  • Wink
  • Moscow, Russia
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@sindresorhus
sindresorhus / esm-package.md
Last active May 3, 2024 10:19
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.
@stonehippo
stonehippo / nodejs_raspberry_pi.md
Last active April 21, 2024 01:07
Methods for installing Node.js on Raspberry Pi

Setting Up Node.js On Raspberry Pi

There are several ways that you can set up Node.js on a Raspberry Pi when running Raspbian/Rapberry Pi OS. Depending on your needs, the version of the RPi that you're using, and how you like to manage installs, you have a lot of options.

Node.js from source

Do not do this if you can avoid it, it's super slow. If you insist on doing it and have the time, you can start at https://nodejs.org. But really, don't do this.

If you have tons of time on your hands, don't need Node anytime soon, and insist on building from source for some reason, here's a guide you can try out that covers building Node.js on an ARMv6 Raspberry Pi.

Side note: unless you have a need for the latest and greatest features, I recommend developing using the most recent Long Term Support (LTS) version of Node available, especially for anything you plan to put into production for any length of time.

@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@sebmarkbage
sebmarkbage / Infrastructure.js
Last active May 2, 2024 03:11
SynchronousAsync.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.