Default keyboard shortcuts for Ghostty terminal emulator. Platform-specific differences are noted where applicable.
| Action | Windows/Linux | macOS |
|---|---|---|
| New window | Ctrl+Shift+N | Cmd+N |
| Close window | Alt+F4 | Cmd+Shift+W |
| /** @type {import('tailwindcss').Config} */ | |
| module.exports = { | |
| content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], | |
| theme: { | |
| extend: { | |
| animation: { | |
| fade: 'fadeIn .5s ease-in-out', | |
| }, |
I've recently ran into a pitfall of [React.memo()][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo() (at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:
const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
<Memoized>bar</Memoized>
// Will re-render every time; the memoization does nothingIf you use server rendering, keep in mind that neither useLayoutEffect nor useEffect can run until the JavaScript is downloaded.
You might see a warning if you try to useLayoutEffect on the server. Here's two common ways to fix it.
If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect instead.
function MyComponent() {I can't find exact specifications on this, but it seems that iOS restricts bringing up the keyboard via programmatically focusing on <input>. It only brings up the keyboard in response to explicit user interaction.
This presents a curious problem when you want to autofocus an input inside a modal or lightbox, since what you generally do is click on a button to bring up the lightbox, and then focus on the input after the lightbox has been opened. Without anything fancy, it actually works ok. The problem shows up when you try to add something fancy like a setTimeout or a promise.then(). I don't know why people would want to use a setTimeout here, but waiting for a promise is actually a pretty common use case. E.g. we try to batch dom manipulations like getting a lightbox to show up inside `requestAnimati
| A Tree is just a restricted form of a Graph. | |
| Trees have direction (parent / child relationships) and don't contain cycles. | |
| It has only one path between any two vertices | |
| They fit with in the category of Directed Acyclic Graphs (or a DAG). | |
| So Trees are DAGs with the restriction that a child can only have one parent. | |
| Directed Acyclic Graphs is a kind of directed graph that have no cycles. |
updated list moved to https://grin.io/coding-maxims
| // Usage: | |
| // Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread | |
| // then use as follows: | |
| // | |
| // query(term | [term, term, ...], term | [term, term, ...], ...) | |
| // | |
| // When arguments are in an array then that means an "or" and when they are seperate that means "and" | |
| // | |
| // Term is of the format: | |
| // ((-)text/RegExp) ( '-' means negation ) |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var jshint = require('gulp-jshint'); | |
| // Command line option: | |
| // --fatal=[warning|error|off] | |
| var fatalLevel = require('yargs').argv.fatal; | |
| var ERROR_LEVELS = ['error', 'warning']; |