Skip to content

Instantly share code, notes, and snippets.

View emersonlaurentino's full-sized avatar

Emerson Laurentino emersonlaurentino

View GitHub Profile
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) {
@sibelius
sibelius / createQueryRendererSuspense.tsx
Created September 25, 2019 15:40
createQueryRendererSuspense helper to make it easy add ErrorBoundaryWithRetry and Suspense handling
export const createQueryRendererSuspense = (Component: React.ComponentType<any>) => {
const QueryRendererWrapper = props => {
return (
<ErrorBoundaryWithRetry fallback={(error, retry) => <ErrorView error={error} retry={retry} />}>
<React.Suspense fallback={<LoadingView />}>
<Component {...props} />
</React.Suspense>
</ErrorBoundaryWithRetry>
);
};
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active July 29, 2024 19:50
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@augbog
augbog / Free O'Reilly Books.md
Last active July 23, 2024 15:24
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.