Skip to content

Instantly share code, notes, and snippets.

View epjuan21's full-sized avatar

Juan Ramirez epjuan21

  • Andes, Antioquia, Colombia
View GitHub Profile
@epjuan21
epjuan21 / DeleteRow.bas
Last active August 15, 2019 20:43
Eliminar Fila Según Criterio en VBA - Delete Row According to Criteria
Sub DeleteRow()
Application.ScreenUpdating = False
'Columna donse se ecuentra el criterio
'Column where the criterion is found
Col = 7
'We set the criteria
'Establecemos el Criterio
@epjuan21
epjuan21 / Commands.txt
Created August 17, 2019 23:25
Instrucciones para subir una aplicación en PHP o Laravel a un servidor Linux con Ubuntu Server
añadir permisos al archivo .pem
chmod 400 <pem>
añadir el archivo .pem a tus claves
ssh-add -K <pem>
acceso ssh a nuestro servidor
ssh -i <pem>.pem ubuntu@<ip>
actualizar repositorios con apt-get
@epjuan21
epjuan21 / InstallLaravelOnIIS.bash
Last active March 2, 2022 17:59
Instalar Laravel en Windows Server IIS
## Instalar Laravel 5.7 en Windows Server 2012 R2 Sobre Internet Information Services
# Nos ubicamos en la carpeta de IIS C:\inetpub\wwwroot
# Ejecutamos el siguiente comando en la terminal
composer create-project --prefer-dist laravel/laravel blog "5.7.*"
## Configurar el Proyecto en IIS
@epjuan21
epjuan21 / removeDuplicates.js
Last active October 21, 2019 15:08
Remove Duplicates From Array
// Remove Duplicates From Array
var fruits = [“banana”, “apple”, “orange”, “watermelon”, “apple”, “orange”, “grape”, “apple”];
// First method
var uniqueFruits = Array.from(new Set(fruits));
console.log(uniqueFruits); // returns [“banana”, “apple”, “orange”, “watermelon”, “grape”]
// Second method
var uniqueFruits2 = […new Set(fruits)];
console.log(uniqueFruits2); // returns [“banana”, “apple”, “orange”, “watermelon”, “grape”]
@epjuan21
epjuan21 / replaceInArray.js
Created October 21, 2019 15:34
Replace the specific value in an array
//Replace the specific value in an array
var fruits = [“banana”, “apple”, “orange”, “watermelon”, “apple”, “orange”, “grape”, “apple”];
fruits.splice(0, 2, “potato”, “tomato”);
console.log(fruits); // returns [“potato”, “tomato”, “orange”, “watermelon”, “apple”, “orange”, “grape”, “apple”]
@epjuan21
epjuan21 / mapArrayWithoutMap.js
Created October 21, 2019 15:35
Map array without .map()
// Map array without .map()
var friends = [
{ name: ‘John’, age: 22 },
{ name: ‘Peter’, age: 23 },
{ name: ‘Mark’, age: 24 },
{ name: ‘Maria’, age: 22 },
{ name: ‘Monica’, age: 21 },
{ name: ‘Martha’, age: 19 },
]
@epjuan21
epjuan21 / emptyAnArray.js
Created October 21, 2019 15:35
Empty an array
// Empty an array
var fruits = [“banana”, “apple”, “orange”, “watermelon”, “apple”, “orange”, “grape”, “apple”];
fruits.length = 0;
console.log(fruits); // returns []
@epjuan21
epjuan21 / convertArrayToAnObject
Created October 21, 2019 15:36
Convert array to an object
// Convert array to an object
var fruits = [“banana”, “apple”, “orange”, “watermelon”];
var fruitsObj = { …fruits };
console.log(fruitsObj); // returns {0: “banana”, 1: “apple”, 2: “orange”, 3: “watermelon”, 4: “apple”, 5: “orange”, 6: “grape”, 7: “apple”}
@epjuan21
epjuan21 / fulFillArrayWithData.js
Created October 21, 2019 15:36
Fulfill array with data
// Fulfill array with data
var newArray = new Array(10).fill(“1”);
console.log(newArray); // returns [“1”, “1”, “1”, “1”, “1”, “1”, “1”, “1”, “1”, “1”, “1”]
@epjuan21
epjuan21 / mergeArrays.js
Created October 21, 2019 15:37
Merge arrays
// Merge Arrays
var fruits = [“apple”, “banana”, “orange”];
var meat = [“poultry”, “beef”, “fish”];
var vegetables = [“potato”, “tomato”, “cucumber”];
var food = […fruits, …meat, …vegetables];
console.log(food); // [“apple”, “banana”, “orange”, “poultry”, “beef”, “fish”, “potato”, “tomato”, “cucumber”]