| name | description |
|---|---|
no-use-effect |
Enforce the no-useEffect rule when writing or reviewing React code.
ACTIVATE when writing React components, refactoring existing useEffect calls,
reviewing PRs with useEffect, or when an agent adds useEffect "just in case."
Provides the five replacement patterns and the useMountEffect escape hatch.
|
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 Webpackbar = require('webpackbar') | |
| module.exports = { | |
| webpack: (config, { isServer }) => { | |
| config.plugins.push(new Webpackbar({ name: isServer ? 'server' : 'client' })) | |
| return config | |
| } | |
| } |
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 { useState } from "react"; | |
| export function useLocalStorage<T>(key: string, initialValue: T): [T, (s: T) => void] { | |
| // State to store our value | |
| // Pass initial state function to useState so logic is only executed once | |
| const [storedValue, setStoredValue] = useState<T>(() => { | |
| try { | |
| // Get from local storage by key | |
| const item = window.localStorage.getItem(key); | |
| // Parse stored json or if none return initialValue |
This helps untract files previous pushed to repo, and then added to .gitignore
git rm -r --cached .
git add .
git commit -m "chore: untracked files issue resolved to fix .gitignore"Here is another example un-tracking files like .env and then removing it from the history
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 css from "rollup-plugin-css-porter"; | |
| import pkg from "../../package.json"; | |
| import resolve from "rollup-plugin-node-resolve"; | |
| import babel from "rollup-plugin-babel"; | |
| import path from "path"; | |
| import commonjs from "rollup-plugin-commonjs"; | |
| import { terser } from "rollup-plugin-terser"; | |
| process.env.BABEL_ENV = "production"; | |
| process.env.NODE_ENV = "production"; |
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
| echo '.env' >> .gitignore | |
| git rm -r --cached .env | |
| git add .gitignore | |
| git commit -m 'untracking .env' | |
| git push origin master |
Sometimes, debugging with console.log is not enough to find out what is
happening in the code, as console.log prints only plain objects but neither
functions nor objects with circular references. Besides, it's possible you
may need to know the context and flow of the code.
Read more about debugging with VS Code in VS Code: Debugging.
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
| xcode-select --install | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew update | |
| brew cask install iterm2 | |
| # update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts | |
| brew install bash # latest version of bash | |
| # set brew bash as default shell | |
| brew install fortune | |
| brew install cowsay | |
| brew install git |
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
| ಠ_ಠ | |
| ( ͡° ͜ʖ ͡°) | |
| ¯\_(ツ)_/¯ | |
| (╯°□°)╯︵ ┻━┻ | |
| http://www.fileformat.info/convert/text/upside-down.htm | |
| WRTTN http://wrttn.me/30dbfd/ | |
| Unicode Emoticons |
NewerOlder
