Skip to content

Instantly share code, notes, and snippets.

View wildiney's full-sized avatar

Wildiney Di Masi wildiney

View GitHub Profile
@wildiney
wildiney / EslintRecipe.md
Last active April 20, 2024 16:48 — forked from felipefontoura/README.md
ESLint Recipe - React, Next and Node.js

Eslint

React / Next.js

npm i prettier eslint eslint-config-prettier eslint-config-standard eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-tailwindcss @typescript-eslint/eslint-plugin @typescript-eslint/parser -D

.eslintrc.js:

@wildiney
wildiney / powershell.txt
Created April 19, 2024 19:47 — forked from aleduca/powershell.txt
Powershell - oh my posh
- Baixar o powershell: https://learn.microsoft.com/pt-br/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#winget
- NerdFont: https://www.nerdfonts.com/font-downloads
- Oh My Posh: https://ohmyposh.dev/
- Criar arquivo de config: .$PROFILE ou code $PROFILE
- Instalar PSReadline: Install-Module PSReadLine -AllowPrerelease -Force
- Instalar icones: Import-Module -Name Terminal-Icons
- Apelido para comandos:
function executeArtisanCli {
php artisan $args
}
@wildiney
wildiney / settings.json
Last active February 26, 2024 12:46
VSCode configs to sticky folders and code content
{
editor.stickyScroll.enabled,
workbench.tree.enableStickyScroll
}
@wildiney
wildiney / handleInputChange.tsx
Created October 11, 2023 13:44
A snippet to deal with the onChange in react forms
const handleInputChange = (e:React.ChangeEvent<HTMLInputElement | HTMLSelectElement>)=>{
const {name, value} = e.target
setState((prevState)=>{
...prevState,
[name]:value
})
}
@wildiney
wildiney / vite.config.js
Last active September 4, 2023 13:03
Vite config for naming dist files
import {defineConfig} from 'vite'
export default defineConfig({
build:{
rollupOptions:{
output:{
assetFileNames:'assets/[name].[ext]',
entryFileNames:'[name].js'
}
}
@wildiney
wildiney / remove-duplicates-in-object.js
Created May 4, 2022 19:51
Remove duplicated entries in an json object
function makeUnique(object){
jsonObject = object.map(JSON.stringify)
const uniqueSet = new Set(jsonObject)
const uniqueArray = Array.from(uniqueSet).map(JSON.parse)
return uniqueArray
}
<?php
chdir('/home/wildi013/symfony4');
if(getcwd()=="/home/wildi013/symfony4"){
exec('php bin/console cache:clear',$v, $o);
echo $v;
echo $o;
} else {
echo "Error (D13)";
}
@wildiney
wildiney / pm2-commands
Created April 17, 2022 22:41
PM2 Basic Usage
# NextJS
pm2 start yarn --name "nextjs" --interpreter bash -- start
// Ensure the folder exists for the mount target (e.g. /mnt/m)
// Open /etc/fstab and add a line such as the following:
M: /mnt/m drvfs defaults 0 0
// Reload the fstab file with sudo mount -a
sudo mount -t drvfs W: /mnt/w