- Set Light mode
defaults write -g NSRequiresAquaSystemAppearance -bool Yes- Log out and log back in
- Set Dark mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const chaosTestStrings = (): void => { | |
| const textNodes = getAllTextNodes(document.body); | |
| for (const node of textNodes) { | |
| const textNodeLength = node.textContent ? node.textContent.length : 0; | |
| if (node.textContent === null) { | |
| return; | |
| } | |
| if (node.parentElement instanceof Element) { | |
| if (node.parentElement.dataset.originalText === undefined) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the | |
| software to the public domain. We make this dedication for the benefit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect, useRef } from "react"; | |
| /* | |
| * A type-safe, polymorphic Box to wrap any forwardRef component | |
| * with an Intersection Observer. Designed to be used in an | |
| * unknown-length array map setting (infinite feed, etc.). | |
| * | |
| * The `callback` prop is closed over the passed-in `id` prop. | |
| * This allows the `callback` prop to keep reference-equality | |
| * between renders using something like `useCallback`, which |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const getProxy = (target = {}, key) => | |
| target[key] || (target[key] = new Proxy({}, { get: getProxy })); | |
| const fillPick = (proxy, fn, fromObject = fn(proxy)) => | |
| Object.assign( | |
| {}, | |
| ...Object.entries(proxy).map(([key, value]) => ({ | |
| [key]: Object.keys(value).length | |
| ? fillPick(value, fn, fromObject[key]) | |
| : fromObject[key], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This code does the equivalent of the node code provided in the GDAX API docs | |
| var secret = 'PYPd1Hv4J6/7x...'; | |
| var timestamp = Date.now() / 1000; | |
| var requestPath = '/orders'; | |
| var body = JSON.stringify(""); // body goes here | |
| // create the prehash string by concatenating required parts | |
| var message = timestamp + method + requestPath + body; |
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.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/