You have to install the multi-command extension in VS Code, because VS Code doesn't handle internally to trigger multiple commands.
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
| { | |
| "key": "capslock", | |
| "command": "extension.vim_escape", | |
| "when": "editorTextFocus && vim.active && !inDebugRepl" | |
| } |
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 { SWRConfig } from "swr"; | |
| import { fetcher } from "@services/apiClient"; | |
| // Your fetcher need to throw error with an statusCode. | |
| const MyApp = () => { | |
| return ( | |
| <SWRConfig | |
| value={{ |
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
| // try it : https://codesandbox.io/s/sample-next-ts-rhf-zod-9ieev | |
| import React from "react"; | |
| import { useForm } from "react-hook-form"; | |
| import { zodResolver } from "@hookform/resolvers/zod"; | |
| import { z } from "zod"; | |
| import type { FieldError } from "react-hook-form"; | |
| // JSON.stringify(error) will not work, because of circulare structure. So we need this helper. |
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
| //https://codesandbox.io/s/quirky-hermann-1xzju?file=/src/App.js | |
| import React, { useState, useEffect } from "react"; | |
| import "./styles.css"; | |
| const useAuth = Component => { | |
| const [isAuthed, setAuth] = useState(false); | |
| useEffect(() => { | |
| setTimeout(() => { | |
| setAuth(true); |
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
| # Create a user named ozon, for example | |
| create user ozon with encrypted password 'ozon'; | |
| # Create a database (see LC_CTYPE and LC_COLLATE if needed) | |
| create database ozon with owner ozon encoding 'UTF8'; |
ESLint and Prettier are 2 importants tools in the JS tools belt. How to make them aware of each other? Here is how.
From:
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
| function undefined() { | |
| // problem solved | |
| } | |
| From: https://dmitripavlutin.com/7-tips-to-handle-undefined-in-javascript/ | |
| #js #undefinedNullHell |