Skip to content

Instantly share code, notes, and snippets.

View irvingvjuarez's full-sized avatar
🔥
On fire

Irving Juárez irvingvjuarez

🔥
On fire
View GitHub Profile
@irvingvjuarez
irvingvjuarez / postFetch.js
Created December 8, 2022 21:37
Main structure to make a post fetch in js
const fetchConfig = {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
method: "POST",
body: JSON.stringify(data)
}
fetch(API, fetchConfig)
@irvingvjuarez
irvingvjuarez / tsconfig.json
Created December 20, 2022 17:50
How to add path aliases in a vite + ts project
{
"compilerOptions": {
...
"paths": {
"@app/*": ["./src/*"]
}
}
}
@irvingvjuarez
irvingvjuarez / Input.tsx
Created December 22, 2022 18:26
How to type a forwardRef component in TS
export const Input = React.forwardRef<refType, propsType>((props, ref) => {
return (
<input ref={ref} />
)
})
@irvingvjuarez
irvingvjuarez / py.md
Last active February 19, 2023 13:44
Command to create a virtual environment in windows

1 - Being Into the project where the environment will be created.

2 - Create the virtual environment: python -m venv [env_name]

3 - Activate the virtual environment in CMD: [env_name]\Scripts\activate.bat or source env/bin/activate

4 - Deactivate virtual environment: [env_name]\Scripts\deactivate.bat or deactivate