Skip to content

Instantly share code, notes, and snippets.

View konami12's full-sized avatar
:electron:
A darle Atomos!

Jorge konami12

:electron:
A darle Atomos!
View GitHub Profile
console.time("Fibonaci recuursivo");
const fibonacci = (value) => {
let result = value;
if (value > 1) {
result = fibonacci(value - 1) + fibonacci(value - 2);
}
return result;
};
fibonacci(1000);
@konami12
konami12 / fetch-generator-function.js
Last active September 29, 2022 17:23
fetch-generator-function.js
const fetch = require("node-fetch");
/**
* Se realiza la peticion a la api solicitada
*
* @param {string} url Ruta correspondiente a la API.
* @return {object}
*/
const requestData = async (url) => {
const REQUEST = await fetch(url);

Mejores prácticas para el uso de github

Creación de ramas

Para la creación de maras se recomienda utilizar la siguiente nomenclatura.

[rama origen]/[type]/[autro]-[idTicket]/[Titulo-de-la-rama]
@konami12
konami12 / LPokemon✅.js
Last active September 4, 2020 02:47
sustitución se Livskov aplicado
class Pokemon {
 #name = ""; 
 #type = ""
 constructor(name, type) {
 this.#name = name;
 this.#type = type;
 }
get name() {
@konami12
konami12 / Lpokemon❌.js
Last active September 4, 2020 01:23
Sin aplicar el principio de sustitucion de lsikov ❌
class Pokemon {
 #name = ""; 
 #type = ""
 constructor(name, type) {
 this.#name = name;
 this.#type = type;
 }
get name() {
@konami12
konami12 / OPokemon.js
Created August 14, 2020 07:24
Opokemon yes
class Pokemon {
#name = "";
#type = "";
constructor(name, type) {
this.#name = name;
this.#type = type;
}
/**
@konami12
konami12 / OPokemon✅.js
Last active September 3, 2020 06:44
Principio abierto/cerrado ✅
class Pokemon {
 #name = ""; 
 #type = ""
 constructor(name, type) {
 this.#name = name;
 this.#type = type;
 }
get name() {
@konami12
konami12 / OPokemon❌.js
Last active September 3, 2020 06:40
Principio abierto/cerrado ❌
class Pokemon {
 #name = ""; 
 #type = ""
 constructor(name, type) {
 this.#name = name;
 this.#type = type;
 }
get name() {
@konami12
konami12 / SolidPokemon✅.js
Last active September 2, 2020 04:06
✅ Principio de Responsabilidad Única
class Pokemon {
 #name = ""; 
 #type = ""
 #evolutions = [];
 constructor(name, type, evolutions) {
 this.#name = name;
 this.#type = type;
 this.#evolutions = evolutions;
 }
@konami12
konami12 / SolidPokemon.js
Last active September 2, 2020 00:55
❌ Principio de Responsabilidad Única
class Pokemon {
 #name = ""; 
 #type = ""
 #evolutions = [];
 constructor(name, type, evolutions) {
 this.#name = name;
 this.#type = type;
 this.#evolutions = evolutions;
 }