Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View edgvi10's full-sized avatar

Eduardo Vieira edgvi10

  • Amora Sistemas, Link Informática RJ
  • Rio de Janeiro
View GitHub Profile
{
"AC": {
"regiao": "Norte",
"estado": "Acre",
"cidades": {
"1200013": "ACRELÂNDIA",
"1200054": "ASSIS BRASIL",
"1200104": "BRASILÉIA",
"1200138": "BUJARI",
"1200179": "CAPIXABA",
@edgvi10
edgvi10 / search.js
Created December 2, 2022 18:40
Função de Busca em arrays e Objetos
const search = (list, keyword, options) => {
options = (options) ? { ...options } : {};
if (options.caseSensitive === undefined) options.caseSensitive = false;
if (options.exactMatch === undefined) options.exactMatch = false;
if (options.exactMatch) options.caseSensitive = true;
if (options.deepSearch === undefined) options.deepSearch = false;
if (options.caseSensitive) keyword = keyword.toString().trim();
else keyword = keyword.toString().trim().toLowerCase();
const sentences = (options.exactMatch) ? [keyword] : keyword.split(" ");

Use Cases:

localstorage.listAll(); // list all keys
localstorage.getAll(); // get all keys
localstorage.get("key"); // return one value
localstorage.get(["key1", "key2"]); // return object of values
localstorage.save("key", "value"); // save one value
localstorage.save({"key1": "value1", "key2": "value2"}); // save multiple values
localstorage.remove("key"); // remove one value
-- Procura a porta que ta presa nessa lista e vê o PID
netstat -ano -p tcp
-- Mata essa desgraçada
taskkill /f /pid [PID]
const isJson = (str) => {
try { JSON.parse(str); }
catch (e) { return false; }
}
export default localstorage = {
listAll: () => Object.keys(localStorage),
getAll: () => localstorage.get(localstorage.listAll()),
get: (key) => {
if (Array.isArray(key)) {
@edgvi10
edgvi10 / _yarn_install.sh
Last active November 11, 2022 02:13
Next.js Install Files
mkdir -p components pages public src styles components/layout components/ui pages/api public/assets public/plugins src/libs src/services
touch .env jsconfig.json next.config.js package.json
touch pages/_app.jsx pages/_document.jsx pages/index.jsx pages/api/index.js public/manifest.json src/libs/utils.js src/services/api.js styles/global.scss styles/nprogress.scss
touch components/layout/.gitkeep components/ui/.gitkeep public/assets/.gitkeep public/plugins/.gitkeep
pnpm i next react react-dom nextjs-cors dbwalker axios locutus sass nprogress
{"AC":[{"codigo":"1200013","municipio":"ACRELANDIA"},{"codigo":"1200054","municipio":"ASSIS BRASIL"},{"codigo":"1200104","municipio":"BRASILEIA"},{"codigo":"1200138","municipio":"BUJARI"},{"codigo":"1200179","municipio":"CAPIXABA"},{"codigo":"1200203","municipio":"CRUZEIRO DO SUL"},{"codigo":"1200252","municipio":"EPITACIOLANDIA"},{"codigo":"1200302","municipio":"FEIJO"},{"codigo":"1200328","municipio":"JORDAO"},{"codigo":"1200336","municipio":"MANCIO LIMA"},{"codigo":"1200344","municipio":"MANOEL URBANO"},{"codigo":"1200351","municipio":"MARECHAL THAUMATURGO"},{"codigo":"1200385","municipio":"PLACIDO DE CASTRO"},{"codigo":"1200807","municipio":"PORTO ACRE"},{"codigo":"1200393","municipio":"PORTO WALTER"},{"codigo":"1200401","municipio":"RIO BRANCO"},{"codigo":"1200427","municipio":"RODRIGUES ALVES"},{"codigo":"1200435","municipio":"SANTA ROSA DO PURUS"},{"codigo":"1200500","municipio":"SENA MADUREIRA"},{"codigo":"1200450","municipio":"SENADOR GUIOMARD"},{"codigo":"1200609","municipio":"TARAUACA"},{"codigo":"

CONTRATO DE PRESTAÇÃO DE SERVIÇOS DE DESENVOLVIMENTO DE PROJETOS

CONTRATO DE PRESTAÇÃO DE SERVIÇOS QUE ENTRE SI FAZEM:

Parte contratante: NOME COMPLETO OU RAZAO SOCIAL (FANTASIA). inscrita no CNPJ/CPF sob o n° CNPJ/CPF, com sede em LOGRADOURO E NÚMERO – BAIRRO, CIDADE (UF) - PAÍS, doravante denominada CONTRATANTE, neste instrumento representada, de acordo com o seu ato constitutivo, pelo NOME COMPLETO DO REPRESENTANTE, documento n° CPF, e Parte contratada: O Desenvolvedor NOME COMPLETO OU RAZAO SOCIAL (FANTASIA), inscrito no CPF/CNPJ sob o nº CPF/CNPJ, residente domiciliado em LOGRADOURO E NÚMERO – BAIRRO, CIDADE (UF) - PAÍS, doravante denominada CONTRATADA.

CLÁUSULA PRIMEIRA – DO OBJETO

O presente contrato tem por objeto regular as condições mediante as quais a CONTRATADA prestará à CONTRATANTE os serviços discriminados na CLÁUSULA SEGUNDA, com fornecimento de mão de obra.

@edgvi10
edgvi10 / javascript.json
Last active February 27, 2022 01:09
Snippets do caralho, irmão!
{
"Next Routes handler": {
"prefix": [
"nexthandler",
"handler"
],
"body": [
"export default async function (req, res) {",
" console.clear();",
" console.log(`${req.method} ${req.url}`);",
@edgvi10
edgvi10 / utils.js
Last active December 2, 2022 15:01
export const isSet = (value) => (value !== undefined && value !== null);
export const isEmpty = (value) => (
(Array.isArray(value) && value.length === 0)
|| (typeof value === "object" && Object.keys(value).length === 0)
|| (typeof value === "string" && value.trim().length === 0)
|| (typeof value === "number" && isNaN(value))
|| value === undefined
|| value === null
);