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
| set-ExecutionPolicy RemoteSigned -Scope CurrentUser | |
| # Then this should read "RemoteSigned" | |
| Get-ExecutionPolicy |
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
| for /F "eol=;" %f in (fileName.txt) do curl -O %f |
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
| # Add the remote, call it "upstream": | |
| git remote add upstream https://github.com/whoever/whatever.git | |
| # Fetch all the branches of that remote into remote-tracking branches | |
| git fetch upstream | |
| # Make sure that you're on your main branch: |
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
| // global cors policy | |
| app.UseCors(x => x.AllowAnyMethod().AllowAnyHeader().SetIsOriginAllowed(origin => true) // allow any origin | |
| .AllowCredentials()); // allow credentials |
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
| // Declaring type of props - see "Typing Component Props" for more examples | |
| type AppProps = { | |
| message: string; | |
| }; /* use `interface` if exporting so that consumers can extend */ | |
| // Easiest way to declare a Function Component; return type is inferred. | |
| const App = ({ message }: AppProps) => <div>{message}</div>; | |
| // you can choose annotate the return type so an error is raised if you accidentally return some other type | |
| const App = ({ message }: AppProps): React.JSX.Element => <div>{message}</div>; |
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
| export const saveJsonAsFile = (filename: any, dataObjToWrite: any) => { | |
| const obj = JSON.parse(dataObjToWrite); | |
| var dataStr = | |
| "data:text/json;charset=utf-8," + | |
| encodeURIComponent(JSON.stringify(obj, null, 4)); | |
| var downloadAnchorNode = document.createElement("a"); | |
| downloadAnchorNode.setAttribute("href", dataStr); | |
| downloadAnchorNode.setAttribute("download", filename); | |
| document.body.appendChild(downloadAnchorNode); // required for firefox | |
| downloadAnchorNode.click(); |
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 { FormControl, InputLabel, MenuItem, Select, SelectChangeEvent } from '@mui/material'; | |
| import axios from 'axios'; | |
| import * as React from 'react'; | |
| import { useEffect, useState } from 'react'; | |
| type Props = {}; | |
| export const ProductsSearch = (props: Props) => { | |
| var token = localStorage.getItem('token'); | |
| const requestHeader = { |
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
| npm i -g npm-check-updates | |
| ncu -u | |
| npm install |
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 * as React from "react"; | |
| interface Props { | |
| children: React.ReactNode; | |
| elementType?: keyof JSX.IntrinsicElements; | |
| } | |
| export default function ({ | |
| children, | |
| elementType: ElementType = "h2", |
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
| { | |
| { | |
| 0: "State0", | |
| 1: "State1", | |
| 2: <Component />, | |
| }[state] | |
| } |
NewerOlder