| Function | Shortcut |
|---|---|
| New Tab | ⌘ + T |
| Close Tab or Window | ⌘ + W (same as many mac apps) |
| Go to Tab | ⌘ + Number Key (ie: ⌘2 is 2nd tab) |
| Go to Split Pane by Direction | ⌘ + Option + Arrow Key |
| Cycle iTerm Windows | ⌘ + backtick (true of all mac apps and works with desktops/mission control) |
CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.
Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file
| import { useSyncExternalStore } from "react"; | |
| // For more on the useSyncExternalStore hook, see https://react.dev/reference/react/useSyncExternalStore | |
| // The code is almost identical to the source code of zustand, without types and some features stripped out. | |
| // Check the links to see the references in the source code. | |
| // The links are referencing the v5 of the library. If you plan on reading the source code yourself v5 is the best way to start. | |
| // The current v4 version contains lot of deprecated code and extra stuff that makes it hard to reason about if you're new to this. | |
| // https://github.com/pmndrs/zustand/blob/fe47d3e6c6671dbfb9856fda52cb5a3a855d97a6/src/vanilla.ts#L57-L94 | |
| function createStore(createState) { |
| function mapPromises(args, callback, concurrency = 3) { | |
| const { promise, resolve } = Promise.withResolvers(); | |
| const results = []; | |
| let cursor = 0; | |
| function next() { | |
| if (cursor < args.length) { | |
| const index = cursor++; | |
| void callback(...args[index]).then(value => { |
I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.
So below I made a list of leetcode problems that are as close to grokking problems as possible.
| const LOOKUP = | |
| "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
| export function encodeBase64(buffer) { | |
| const view = new Uint8Array(buffer); | |
| let out = []; | |
| for (let i = 0; i < view.length; i += 3) { | |
| const [b1, b2 = 0x10000, b3 = 0x10000] = view.subarray(i, i + 3); | |
| out.push( | |
| b1 >> 2, |
| /* jshint esversion: 6 */ | |
| // Solve the following prompts using recursion. | |
| // 1. Calculate the factorial of a number. The factorial of a non-negative integer n, | |
| // denoted by n!, is the product of all positive integers less than or equal to n. | |
| // Example: 5! = 5 x 4 x 3 x 2 x 1 = 120 | |
| // factorial(5); // 120 | |
| var factorial = function(n) { | |
| if (n < 0) return null; |
| // We extend from React.HTMLAttributes to get all the HTML attributes | |
| // Don't extend React.HTMLProps! | |
| export interface IGreenBoxProps extends React.HTMLAttributes<HTMLDivElement> { | |
| title: string; | |
| } | |
| class GreenBox extends React.Component<IGreenBoxProps, void> { | |
| public render() { | |
| // If you don't spread children and title, the restProps | |
| // still contain these props and compiler will say "no" |
The initial source comes from sdcuike/issueBlog#4
https://github.com/PacktPublishing free to download books code by Packet
https://github.com/EbookFoundation/free-programming-books Very immense