This file contains 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
const isValidEmail = ( email: string ) => { | |
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return re.test(email); | |
} |
This file contains 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
/// get random index from the lenght of the array | |
let randomIndex = Math.floor(Math.random() * array.length) |
This file contains 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
{// Configuraciones para integrar ESLint, prettier y vscode | |
"editor.formatOnSave": true, | |
// Colocar Off el format de JS y JSX, para poder hacerlo via Eslint | |
"[javascript]": { | |
"editor.formatOnSave": false | |
}, | |
"[javascriptreact]": { | |
"editor.formatOnSave": false | |
}, | |
// Esto le dice al plugin de ESLint que cualquier lint se ejecute al salvar. |
This file contains 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
/* | |
* @param row Array of Objects | |
* @param filterKey String | |
* @return Array of Objects | |
*/ | |
const getFilteredRows = (rows, filterkey) => ( | |
rows.filter((row) => JSON.stringify(row).toLowerCase().includes(filterkey)) | |
); |
This file contains 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
#!/bin/bash | |
# sprit to execute in a particular envionment | |
# rememeber made excutable sudo chmod +x werocomands.sh | |
# & run it where raspistill & v4l2 is enable | |
echo "Start wero's Scripts" | |
echo "Script one" | |
./raspistill -cs 0 -o test.jpg | |
sleep 1 | |
echo "Script two" |
This file contains 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
/* | |
combine 2 arrays | |
*/ | |
const addMoreItemsInArray = (array = [], newItems = []) => [...array, ...newItems]; |
This file contains 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
// Create Base64 Object | |
var Base64 = { | |
_keyStr: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', | |
encode: function (e) { | |
var t = ''; var n, r, i, s, o, u, a | |
var f = 0 | |
e = Base64._utf8_encode(e) | |
while (f < e.length) { | |
n = e.charCodeAt(f++) | |
r = e.charCodeAt(f++) |
This file contains 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
// https://developers.google.com/web/tools/chrome-devtools/console/?hl=es | |
const dogs = [{name: 'Snokers', age: 2}, {name: 'Dogger', age: 8}] | |
// regular | |
console.log('hello') | |
// interpolate | |
console.log('Hello i am %s old', dogs[0].age) | |
// template string whit Esc6 | |
console.log(`Hello i am ${dogs[0].age} old`) | |
// styled |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<textarea name="text" id="text" cols="30" rows="10"></textarea> | |
<button id="button">Convert</button> |