Skip to content

Instantly share code, notes, and snippets.

@shahab65
shahab65 / ts.md
Last active October 4, 2020 13:46

ref

const divRef = React.useRef<HTMLDivElement>(null);
const myRef = React.useRef<HTMLElement | null>(null)

call back

interface Events {
  on(eventName: string, callback: () => void):void;

function with if in styled components

const Title = styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
  ${() => {
    let a = 1 + 2 + 3 + 4;
    let b = a / 2;
 if (b &lt; 6) {
@shahab65
shahab65 / handy.md
Last active November 22, 2020 20:20
import { useTranslation } from "react-i18next";
  const { t } = useTranslation();
{t("Prepaid")}

import { makeStyles } from "@material-ui/core/styles";
import { createUseStyles } from "react-jss";
@shahab65
shahab65 / git.md
Last active November 15, 2020 20:45

whatching our global git setting in default editor:

git config --global -e

setting default editor:

git config --global diff.tool vscode

setting end of line:

set verdaccio as npm registry:

npm set registry http://localhost:4873/

what is my curent npm registry(your terminal must not be open in a .npmrc folder)

 npm config get  registry

how to return to normal npm registry?