This file contains 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
{ | |
"editor.quickSuggestions": { | |
"other": true, | |
"comments": false, | |
"strings": true | |
}, | |
"workbench.iconTheme": "material-icon-theme", | |
"editor.fontSize": 17, | |
"[javascript]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" |
This file contains 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
*Set up a pretty git log* | |
**run:** | |
`git config --global alias.lg "log --graph --pretty=format:'%C(auto)%h -%d %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"` | |
**to use:** | |
`git lg` |
This file contains 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
File > Preferences > Keyboard Shortcuts | |
Above the search bar on the right you'll see a icon that when you hover over says "Open Keyboard Shortcuts (JSON)", click on it | |
Add this to the JSON settings: | |
{ | |
"key": "alt+a", | |
"command": "editor.action.insertSnippet", | |
"when": "editorTextFocus", | |
"args": { | |
"snippet": "console.log('${TM_SELECTED_TEXT}$1')$2" |
This file contains 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
display: -webkit-box; | |
-webkit-line-clamp: 2; // amount of lines u want | |
-webkit-box-orient: vertical; | |
overflow: hidden; | |
/* without clamp, good to know asked in interviews */ | |
text-overflow: ellipsis; | |
overflow: hidden; | |
white-space: nowrap; |
This file contains 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
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never } | |
export type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U |
This file contains 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 type { KeyboardEvent } from 'react' | |
import { useCallback, useEffect, useRef, useState } from 'react' | |
import type { FieldError, Path, UseFormClearErrors, UseFormSetValue } from 'react-hook-form' | |
import OutsideClickHandler from 'react-outside-click-handler' | |
import styled from 'styled-components' | |
import InputError from '@/components/shared/InputError' | |
type SelectOption = { | |
value: string |
This file contains 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 syntaxHighlight(json) { | |
if (typeof json != 'string') { | |
json = JSON.stringify(json, undefined, 2); | |
} | |
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); | |
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { | |
let cls = 'number'; | |
if (/^"/.test(match)) { | |
if (/:$/.test(match)) { | |
cls = 'key'; |
This file contains 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
name: Node Continuous Integration | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test_pull_request: | |
runs-on: ubuntu-latest |
This file contains 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 type { Middleware } from 'redux' | |
import { logger } from 'redux-logger' | |
const customLogger: Middleware = (api) => (next) => (action) => { | |
if (window.__REDUX_LOGGER__) return logger(api)(next)(action) | |
return next(action) | |
} | |
export default customLogger |
This file contains 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
name: Node.js CI | |
on: [push, pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [10.x, 12.x, 14.x, 15.x] |
OlderNewer