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
| { | |
| "generalConfiguration.sortOnBeforeSave": true, | |
| "importStringConfiguration.maximumNumberOfImportExpressionsPerLine.type": "newLineEachExpressionAfterCountLimitExceptIfOnlyOne", | |
| "importStringConfiguration.maximumNumberOfImportExpressionsPerLine.count": 80, | |
| "importStringConfiguration.tabSize": 2, | |
| "importStringConfiguration.quoteMark": "double" | |
| } |
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 { MDXRemote } from "next-mdx-remote" | |
| import ImageFixed from "next/image" | |
| import { Fragment } from "react" | |
| import Image from "@/components/CustomImage" | |
| import HeadingsH2 from "@/components/HeadingsH2" | |
| import HoverBullet from "@/components/HoverBullet" | |
| import MDXComponents from "@/components/MDXComponents" | |
| import { PageSeo } from "@/components/SEO" | |
| import TitleJSXWithOptionalHighlighting from "@/components/TitleJSXWithOptionalHighlighting" |
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 { PageSeo } from "@/components/SEO" | |
| import siteMetadata from "@/data/siteMetadata.json" | |
| import Image from "@/components/CustomImage" | |
| import { MDXRemote } from "next-mdx-remote" | |
| import MDXComponents from "@/components/MDXComponents" | |
| import { Fragment } from "react" | |
| import ImageFixed from "next/image" | |
| import { BUTTON, DIVIDER } from "@/components/UTILS" | |
| import TitleJSXWithOptionalHighlighting from "@/components/TitleJSXWithOptionalHighlighting" | |
| import HeadingsH2 from "@/components/HeadingsH2" |
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 size = 5 | |
| <SocialSvg className={`fill-current h-${size} w-${size} m-2`} /> |
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 Email from "./email.svg" | |
| import Medium from "./medium.svg" | |
| import Linkedin from "./linkedin.svg" | |
| import Twitter from "./twitter.svg" | |
| // Icons taken from: https://simpleicons.org/ | |
| const components = { | |
| email: Email, | |
| medium: Medium, |
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 error due to leading underscore: | |
| import _Document from "@/src/pages/_document" | |
| // ✅ SCREAMING_SNAKE_CASE | |
| import NEXT_DOCUMENT from "@/src/pages/_document" | |
| // ✅ PascalCase | |
| import NextDocument from "@/src/pages/_document" |
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
| console.log([undefined,"👋",null,"","🌎",0].filter(Boolean)) // ["👋","🌎"] | |
| console.log(["👋",0,"🌎"].filter((item)=>Boolean(item))) // ["👋","🌎"] |
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 async function getStaticPaths() { | |
| // search 1 level recursively in @/data/ | |
| const dataRegExpMarkdown = /(.+)?\\(.+)?\\(.+)?\.md/ | |
| // ["data\\hosting\\packages.md", "data", "hosting", "packages"] | |
| const paths: any[] = getFilesRecursively("data") | |
| .map((path: string) => dataRegExpMarkdown.exec(path)) | |
| .filter((item: any[]) => Boolean(item)) // remove falsy | |
| .map((item: any[]) => ({ | |
| params: { | |
| path: item[2], // "hosting" (supports 1 directory) |
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
| {"version":1,"resource":"file:///c%3A/dev/learn-penguin/pages/level/%5Bworld%5D/%5Bid%5D.page.tsx","entries":[{"id":"9tdt.tsx","timestamp":1653504720885},{"id":"jDGs.tsx","timestamp":1653504732111},{"id":"MBQa.tsx","timestamp":1653504747566},{"id":"GQjv.tsx","timestamp":1653504823082},{"id":"Lw3z.tsx","source":"undoRedo.source","timestamp":1653504827867},{"id":"r3mT.tsx","timestamp":1653504833056},{"id":"j0mh.tsx","source":"undoRedo.source","timestamp":1653504838631},{"id":"FV1x.tsx","timestamp":1653504845182},{"id":"NSBn.tsx","timestamp":1653504958300},{"id":"eXJ4.tsx","timestamp":1653504987900},{"id":"cQZy.tsx","source":"Workspace Edit","timestamp":1653516573565},{"id":"XC0w.tsx","timestamp":1653516595199},{"id":"5sZe.tsx","source":"Workspace Edit","timestamp":1653516620077},{"id":"Ndpg.tsx","timestamp":1653516622869},{"id":"QXsn.tsx","timestamp":1653516925743},{"id":"8BEe.tsx","timestamp":1653516937811},{"id":"w2EA.tsx","timestamp":1653516961799},{"id":"vkkV.tsx","timestamp":1653517188004},{"id":"gvlE.tsx" |
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
| Array size: | 10 items | 1,000 items | 100,000 items | 1,000,000 items | |
|---|---|---|---|---|---|
| .includes() | Fastest | Fastest | 47.07% slower | 46.77% slower | |
| .filter() | 97.16% slower | 99.99% slower | 97.69% slower | 97.66% slower | |
| .some() | 84.81% slower | 99.98% slower | 95.11% slower | 95.01% slower | |
| for loop | 84.2% slower | 99.62% slower | Fastest | Fastest | |
| .find() | 85.74% slower | 99.98% slower | 95.19% slower | 95.06% slower |