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
// my array declaration with each object and cars details | |
const arrCars = [ | |
{ type: "Wagon", make: "Infiniti", color: "Gray", year:"2018" }, | |
{ type: "Sedan", make: "Honda", color: "Black" , year:"2020"}, | |
{ type: "Convertible", make: "Porsche", color: "Silver" , year:"2014"}, | |
{ type: "Hatchback", make: "Volkswagen", color: "White", year:"2012" } | |
]; | |
// function to pull this information via map method | |
function pluck(array, arg01,arg02,arg03,arg04) { | |
// let us declare the container of the generated array |
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 us start writing the main class, from Here I will build the other ones by extending it | |
class Monster { | |
constructor(options) { | |
this.name = options.name; | |
this.type = options.type; | |
this.ingest = options.ingest; | |
this.health = 100; | |
} | |
Introduce(msg) { | |
return `Hey humans: My name is ${this.name}. ${msg}.`; |
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
// Using Array Helpers Excercise - This uses Filter() | |
const numbers = [10, 20, 30]; | |
function reject(){ | |
let lessThanFifteen = numbers.filter(function(number){ | |
return number < 15; | |
}); | |
return ` Number that is less than 15 is: ${lessThanFifteen}`; | |
} | |
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
// WE WILL CONVERT AN ARRAY OF OBJECTS INTO AN ARRAY USING THE MAP HELPER AND DESTRUCTURING | |
// WE WILL BE USING SOME OF THE COURSES OF UNIVERSIDAD DE INGIENERIA [UNI] MANAGUA AS SAMPLES | |
const classes = [ | |
["Cloud Computing", "9:00 AM", "Danilo Rodríguez", "Estudios de Posgrado"], | |
[ | |
"Hacking y Ciber Seguridad", | |
"8:00 AM", | |
"Jorge Gutiérrez", | |
"Recinto Ricardo Morales Avilés" | |
], |
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
// Ready for Gist | |
"use strict"; | |
const start_codon = "AUG"; | |
const stop_codon = "STOP"; | |
const codon_to_amino_acid = { | |
AUG: "Met", | |
CAA: "Gln", | |
CAG: "Gln", | |
GGU: "Gly", | |
GCG: "Ala", |
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
// Global function to generate a rnd number | |
const rndNumber = (maxNumber = 30, minNumber = 1) => { | |
return Math.floor(Math.random() * maxNumber) + minNumber; | |
}; | |
// main function goes here, we destructure the variables to be used | |
const coVid19NI = ({ | |
intReportedCases, | |
objDate = new Date(), | |
currentDate = objDate.toDateString(), | |
contactedOnes = rndNumber(30), |
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> | |
<body> | |
<h4>Sign Up Form Marca ACME</h4> | |
<p>Please type your name to generate its user name:</p> | |
<b>Name </b><input type="text" id="name" onkeyup="handleChange()"><br/><br/> | |
<b> User </b><input type="text" id="username"> | |
<p id="displaymsg"></p> |
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
#Made with ❤️ in Python 3 by Alvison Hunter - Last Edited on July 9th, 2020 | |
# calculate the age in years, days and hours for an individual as well as preferred programming language. | |
from enum import Enum | |
import datetime | |
def main(): | |
# Using enum class to create the age range enumerations | |
class age_cat(Enum): | |
BABY = "you are still a baby" | |
CHILD = "you are still a child" | |
YOUNG = "you are certainly young" |
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
// This function will generate a random string based on the parameter number, useful for temp passwords | |
const fnRandomString = (argLength) => { | |
let generatedString = ''; // receptor of the generated string, this will contain the x amount of character based on args | |
let baseString = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*+&^%$#!'; | |
let charactersLength = baseString.length; | |
// refactor this to a ES6 friendly version, by using one of the looping helpers that we count with in ES6 | |
[...baseString].every(function(element,index) { | |
// start building the string getting a random character each time based on the baseString | |
generatedString += baseString.charAt(Math.floor(Math.random() * charactersLength)) ; | |
// using the index of this helper, if it is equal to args-1 we stop the loop, otherwise |
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
# This function will generate a random string with a lenght based | |
# on user input number. This can be useful for temporary passwords | |
# or even for some temporary login tokens. | |
# Made with ❤️ in Python 3 by Alvison Hunter - December 28th, 2020 | |
from random import sample | |
import time | |
from datetime import datetime | |
# We will incorporate some colors to the terminal | |
class bcolors: | |
PRIMARY ='\033[34m' |
OlderNewer