```mermaid
sequenceDiagram
participant dotcom
participant iframe
participant viewscreen
dotcom->>iframe: loads html w/ iframe url
iframe->>viewscreen: request template
viewscreen->>iframe: html & javascript
iframe->>dotcom: iframe ready
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 { useRouter } from "next/router"; | |
import { ParsedUrlQuery } from "querystring"; | |
interface UseRouterParamsOptions { | |
method?: "push" | "replace"; | |
shallow?: boolean; | |
} | |
const useRouterParams = (options?: UseRouterParamsOptions) => { | |
const { query, pathname, push, replace } = useRouter(); |
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
await new Promise(function (resolve) { | |
setTimeout(function () { | |
resolve(); | |
}, 1000); | |
}); | |
// ... Can be shortened to: | |
await new Promise(function (resolve) { | |
setTimeout(resolve, 1000); |
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
async function *getStuff(urls) { | |
showSpinner(); | |
try { | |
for (let url of urls) { | |
let resp = await fetch(url); | |
yield await resp.json(); | |
} | |
} | |
finally { | |
hideSpinner(); |
Error
The authenticity of host 'github.com (140.82.113.4)' can't be established.
Fix
ssh-keyscan github.com >> ~/.ssh/known_hosts
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 { useRef, useCallback, useEffect, useState } from 'react'; | |
import { ResizeObserver as ResizeObserverPolyfill } from '@juggle/resize-observer'; | |
const ResizeObserver = window.ResizeObserver || ResizeObserverPolyfill; | |
export default function useResizeObserver() { | |
const [size, setSize] = useState({ width: 0, height: 0 }); | |
const resizeObserver = useRef(null); | |
const onResize = useCallback(entries => { |
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 styles = theme => ({ | |
drawer: { | |
position: 'absolute', | |
overflowX: 'hidden', | |
zIndex: theme.zIndex.drawer + 2, | |
[theme.breakpoints.up('sm')]: { | |
position: 'relative', | |
width: drawerWidth, | |
flexShrink: 0, |
Here is a short guide that will help you setup your environment to create signed commits
or signed tags
with Git locally. This has been extensively tested on Windows with Git and the Github Desktop application: I use it every day for my professional development projects.
I you face any issue, feel free to leave a comment below.
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 could be improved... (ex. ignore interfaces/type aliases that describe a parameter type in the same file) | |
import { Project, TypeGuards, Node } from "ts-morph"; | |
const project = new Project({ tsConfigFilePath: "tsconfig.json" }); | |
for (const file of project.getSourceFiles()) { | |
file.forEachChild(child => { | |
if (TypeGuards.isVariableStatement(child)) { | |
if (isExported(child)) | |
child.getDeclarations().forEach(checkNode); |
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
"workbench.colorCustomizations": { | |
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast. | |
"contrastActiveBorder": "", | |
"contrastBorder": "", | |
// Base Colors | |
"focusBorder": "", | |
"foreground": "", | |
"widget.shadow": "", | |
"selection.background": "", | |
"descriptionForeground": "", |
NewerOlder