Skip to content

Instantly share code, notes, and snippets.

View Noitidart's full-sized avatar

Noitidart Noitidart

View GitHub Profile

React Compiler: What We Learned

A practical guide to understanding what the React Compiler does, when it helps, and when you still need memo().


What the React Compiler Does

The compiler runs at build time and transforms your components to add automatic caching. It inserts a cache (_c()) inside every component and hook, storing cached JSX elements, computed values, and function references.

@Noitidart
Noitidart / index.html
Created June 9, 2026 05:05
Electron Fiddle: app.dock.bounce('critical') throttling repro — macOS Tahoe
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Dock Bounce Test</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
padding: 40px;
background: #1e1e1e;
@Noitidart
Noitidart / .gitignore
Last active May 25, 2026 15:56
Difftastic Git Shortcuts — structural diff aliases (gdu, gds, gdh, gdb, gdr, gl, glo)
.DS_Store
@Noitidart
Noitidart / README.md
Last active May 15, 2026 06:47
Run local opencode changes in VS Code integrated terminal so the tab renames to 'opencode' (not 'bun') — required for the IDE extension (cmd+opt+k) to detect the running CLI. See https://opencode.ai/docs/ide/

Run local opencode in VS Code integrated terminal

VS Code renames terminal tabs to match the foreground process name. If the tab shows bun instead of opencode, the IDE extension (cmd+opt+k) won't detect the running CLI. This setup fixes that.

Setup

  1. Install bun (if not already):
import * as FileSystem from 'expo-file-system';
import { Platform } from 'react-native';
import { IStorageEngine } from 'lib/persistoid';
import { addDebugBreadcrumb, addErrorBreadcrumb } from 'lib/sentry';
function isAndroidMissingFileOrDirectoryError(error: unknown) {
if (
Platform.OS === 'android' &&
hasMessage(error) &&
@Noitidart
Noitidart / _ff-addon-snippet-IsWorktationLocked.js
Last active February 10, 2025 05:58
_ff-addon-snippet-IsWorktationLocked - Detects if workstation is locked or not. (Windows) (jsctypes)
Cu.import('resource://gre/modules/ctypes.jsm')
var wintypesInit = function() {
// BASIC TYPES (ones that arent equal to something predefined by me)
this.BOOL = ctypes.bool;
this.DWORD = ctypes.uint32_t;
this.HANDLE = ctypes.voidptr_t;
this.INT = ctypes.int;
this.PVOID = ctypes.voidptr_t;
@Noitidart
Noitidart / _git-submodule-tips.md
Last active August 8, 2024 23:59
Tips for working with git submodules

Tips for Working With git Submodules

Cloning Repo with Submodules

  1. Use the --recursive flag:

     git clone https://github.com/aikiframework/json.git --recursive
    

    However if you cannot, as Github desktop app on clone does not use this flag, then do this after clone:

@Noitidart
Noitidart / _template-BootstrapJSM.xpi
Last active July 25, 2024 13:07
ff-addon-template: Template for how to create a JSM module.
function splitCubicBezier(options) {
var z = options.z,
cz = z-1,
z2 = z*z,
cz2 = cz*cz,
z3 = z2*z,
cz3 = cz2*cz,
x = options.x,
y = options.y;
@Noitidart
Noitidart / _js-snippet-CubicBezierSplit2.js
Created May 5, 2014 06:22
_js-snippet-CubicBezierSplit2 - This split method is from iScriptDesign.com under "Tutorial > Split Bezier" I'm posting here in case that site goes down.
Split bezier
Shows the possibility to split a bezier curve, two separate techniques are used:
Bernstein's Polynomials
Casteljau's Algorithm
Bernstein's Polynomials
The Bernstein Polynomial implemented in javascript reads as:
getBezier = function getBez(percent,p1,cp1,cp2,p2) {