📌 KEEP IT = {
🎯 Especifico
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 | |
# Check if a port number was provided | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 port_number" | |
exit 1 | |
fi | |
# Assign the first argument to a variable | |
PORT=$1 |
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
// VARIABLES ************************************************************************** | |
// Swapping Two Variables | |
[foo, bar] = [bar, foo]; | |
// Conditional asignation | |
const fullName = name || 'buddy'; | |
// NUMBERS ************************************************************************** | |
// Check if a number is even | |
const isEven = (num) => num % 2 === 0; |
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
//Promise.all | |
//Devuelve todas las promesas o el primer reject que ocurra | |
//***********************************************************************************/ | |
const names = ["Victoria", "Ivan", "Katya", "Lina", "Jack"]; | |
//Promise declaration | |
const returnAfter1sec = (value) => { | |
return new Promise((resolve, reject) => { |
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
let name = "John Doe"; | |
console.log(typeof name); | |
//Use template string | |
const user = "Ariel", | |
company = "Laguna"; | |
const welcomeMsg = `Welcome ${user} to ${company}`; | |
//Number to String | |
let num = 99.97; |
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
//Arrays elements could be with different types | |
let user = ["Ariel", 24, "Diaz"]; | |
let [name, age, lastname] = user; | |
var arr = ["Pear", "Apple", "Orange"]; | |
//CHECK IF IS AN ARRAY | |
console.log(Array.isArray(arr)); |
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
//Switch case vs Const Object Performance | |
//Const Object is 20%-50% faster | |
//Comment the lines of code for "counter [x] ++;" and check the difference | |
const NAMES = [ | |
'Zarya', | |
'Inna', | |
'Antoniya', | |
'Filippa', | |
'Irina', |
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
let getUser = async (userId) => { | |
let promise = new Promise((resolve, reject) => { | |
sql.query("SELECT * FROM `users` WHERE `id`=" + userId).then((userInfo) => { | |
resolve(userInfo); | |
}).catch((reject) => { //Sql reject |
sudo kill -9 sudo lsof -t -i:3838
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
#SSH vs HTTP | |
Si usas HTTP por consola, te va a pedir usuario y contraseña o contraseña cada vez que realizas un pull/push | |
Si usas SSH, tus credenciales quedan guardadas en la PC y no necesitas loguearte para realziar acciones, pero para ello necesitas tener una key SSH en la PC/Servidor vinculada con la cuenta de github. | |
>En Windows Descargar git bash : [https://git-scm.com/](https://git-scm.com/) | |
## HTTP / SSH | |
Para usar git bash primero hay que configurar el usuario (probablemente si usaron github desktop esto no es necesario) | |
Ejecutar en el terminal: |
NewerOlder