Skip to content

Instantly share code, notes, and snippets.

View Saadnajmi's full-sized avatar

Saad Najmi Saadnajmi

View GitHub Profile
@jamonholmgren
jamonholmgren / react-native-macos-start.md
Last active March 5, 2026 08:32
Getting started with react-native-macos (as of May 2, 2025 -- version 0.78.3)

Getting started with react-native-macos

React Native for macOS is a really powerful implementation of React Native for building Mac apps, but the RN macos documentation (as of today) is straight up wrong and won't work.

Here's how to spin one up!

Prerequisites

This assumes you are on a Mac and have installed all the prerequisites for RN iOS.

const ListAccessibilityExamples: React.FunctionComponent = () => {
const [showImage, setShowImage] = React.useState(true);
const [showPresence, setShowPresence] = React.useState(false);
const [showRing, setShowRing] = React.useState(false);
const redSquareStyle: ViewStyle = { width: 20, height: 20, margin: 10, backgroundColor: 'red' };
const cardStyle: ViewStyle = { width: 40, height: 40, margin: 10, backgroundColor: 'white', borderWidth: 1 };
return (
<View>
@sindresorhus
sindresorhus / esm-package.md
Last active March 9, 2026 05:54
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.
@mittsh
mittsh / LMWindow.m
Created September 23, 2013 10:11
How to debug your key view loop: highlights
/*
* Copyright (c) 2013 Micha Mazaheri
* Released under the MIT License: http://opensource.org/licenses/MIT
*/
#define LMWindowDEBUGResponders
#ifdef LMWindowDEBUGResponders
static BOOL _showFirstResponderOverlay = YES;
#endif