Skip to content

Instantly share code, notes, and snippets.

Avatar

Eduardo Vieira edgvi10

  • Amora Sistemas, Link Informática RJ
  • Rio de Janeiro
View GitHub Profile
@edgvi10
edgvi10 / search.js
Created Jan 17, 2022
Função de Busca por objetos ou arrays em javascript
View search.js
export const search = (list, keyword, options) => {
const results = [];
if (options === undefined) options = {};
if (typeof list === "object") {
Object.keys(list).map(item_index => {
const item = list[item_index];
if (typeof item === "object") {
var keys = Object.keys(item);
View material-colors.min.css
:root{--md-black:#000000;--md-white:#ffffff;--md-red:var(--md-red-500);--md-red-50:#ffebee;--md-red-100:#ffcdd2;--md-red-200:#ef9a9a;--md-red-300:#e57373;--md-red-400:#ef5350;--md-red-500:#f44336;--md-red-600:#e53935;--md-red-700:#d32f2f;--md-red-800:#c62828;--md-red-900:#b71c1c;--md-red-a100:#ff8a80;--md-red-a200:#ff5252;--md-red-a400:#ff1744;--md-red-a700:#d50000;--md-pink:var(--md-pink-500);--md-pink-50:#fce4ec;--md-pink-100:#f8bbd0;--md-pink-200:#f48fb1;--md-pink-300:#f06292;--md-pink-400:#ec407a;--md-pink-500:#e91e63;--md-pink-600:#d81b60;--md-pink-700:#c2185b;--md-pink-800:#ad1457;--md-pink-900:#880e4f;--md-pink-a100:#ff80ab;--md-pink-a200:#ff4081;--md-pink-a400:#f50057;--md-pink-a700:#c51162;--md-purple:var(--md-purple-500);--md-purple-50:#f3e5f5;--md-purple-100:#e1bee7;--md-purple-200:#ce93d8;--md-purple-300:#ba68c8;--md-purple-400:#ab47bc;--md-purple-500:#9c27b0;--md-purple-600:#8e24aa;--md-purple-700:#7b1fa2;--md-purple-800:#6a1b9a;--md-purple-900:#4a148c;--md-purple-a100:#ea80fc;--md-purple-a200:#e
View mask.js
export const mask = function (m, str) {
if (str === undefined || str === null) return '';
var m,
l = (m = m.split("")).length,
s = str.split(""),
j = 0,
h = "";
for (var i = -1; ++i < l;)
if (m[i] != "#") {
View gist:5d34b4b9bbb2acf030d31ec0fd77ce22
https://exp-shell-app-assets.s3.us-west-1.amazonaws.com/android/%40nox_0202/pdv-10-dbf8027fc0ad4ce7b6ec49f0f989d6fe-signed.apk
View wtc
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
@edgvi10
edgvi10 / db.js
Last active Jan 20, 2022
Classe para manipulação de banco de dados MySQL em Javascript. Versão 2.1
View db.js
import mysql from 'serverless-mysql';
export default class DB {
constructor(connect_params) {
if (connect_params) {
const params = {};
if (connect_params.host) [params.host, params.port] = connect_params.host.split(":");
if (connect_params.user) params.user = connect_params.user;
if (connect_params.password) params.password = connect_params.pass;
if (connect_params.database) params.database = connect_params.base;
@edgvi10
edgvi10 / utils.js
Created Oct 16, 2021
javascript utils
View utils.js
export const isJson = (string) => {
try {
JSON.parse(string);
return true;
} catch (err) {
return false;
}
}
export const extractInt = (string) => {
View gist:089509b7cedff28f7bc124f5cf11c2a6
UPDATE `produtos` SET
`CODIGO_INTERNO` = TRIM('0' FROM `CODIGO_BARRAS`),
`CODIGO_BARRA_REF` = `CODIGO_BARRAS`,
`CODIGO_FORNECEDOR` = '0001',
-- `CODIGO_LOJA` = '002',
`DATA_CAD` = DATE(NOW()),
`DATA_ALT` = DATE(NOW()),
`DATAINI_PROM` = DATE(NOW()),
`DATAFIM_PROM` = DATE(NOW()),
@edgvi10
edgvi10 / commands.sh
Last active Nov 26, 2021
NextJS project Pack
View commands.sh
npm i next react react-dom axios serverless-mysql md5 uuidv4 cors localforage date-fns sass
mkdir public src styles
mkdir public/assets src/pages src/libs src/services src/components
mkdir src/components/templates src/components/layouts src/pages/api
mkdir src/pages/api/frontend src/pages/api/dashboard
View material-colors.css
:root {
--md-red-50: #ffebee;
--md-red-100: #ffcdd2;
--md-red-200: #ef9a9a;
--md-red-300: #e57373;
--md-red-400: #ef5350;
--md-red-500: #f44336;
--md-red-600: #e53935;
--md-red-700: #d32f2f;
--md-red-800: #c62828;