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
/* | |
logger: { | |
connectionString: "mongodb+srv://usrmongotdapp:Mongo2018@personalizacionqas-xfhrx.mongodb.net", | |
database: "StreamLog", | |
collection: "Logs", | |
defaultSource: "lb.estrategia", | |
enableLogInfo: true, | |
enableLogError: true | |
} | |
*/ |
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
"use strict"; | |
const redisConnection = require("./redis-connection"); | |
const redis = new redisConnection(); | |
(async () => { | |
try { | |
let rr = await redis.get("dataPrueba"); | |
console.log(rr); | |
} catch (error) { |
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
"use strict"; | |
const redisConnection = require("./redis-connection"); | |
const redis = new redisConnection(); | |
(async () => { | |
try { | |
// Para este caso haremos uso de un JSON, tambien se puede guardar string, int, double, etc. | |
let data = [{ | |
"_id": "5c21d04d34b4a04750f9aa6f", |
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
"use strict"; | |
const redis = require("ioredis"); | |
const config = require("./config"); | |
module.exports = class RedisConnection { | |
constructor() { | |
this.client = this.connect(); | |
} |
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 config = { | |
redis: { | |
port: 6379, | |
host: "localhost", | |
retries: 3, | |
time_to_retry: 100, | |
time_live: 3600 // tiempo de vida en segundos | |
} | |
} |
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
{ | |
"name": "[nombre]", | |
"version": "[versión]", | |
"description": "[descripción]", | |
"main": "", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Hugo Roca - hugo.rock20@hotmail.com", | |
"license": "[licencia]" |
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 name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
* { | |
box-sizing: border-box; | |
} | |
body { | |
font: 16px Arial; |
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
// validación para poner a decimales | |
var formatNumber = { | |
separador: ",", | |
sepDecimal: '.', | |
formatear: function (num) { | |
num += ''; | |
var splitStr = num.split('.'); | |
var splitLeft = splitStr[0]; | |
var splitRight = splitStr.length > 1 ? this.sepDecimal + splitStr[1] : ''; | |
var regx = /(\d+)(\d{3})/; |
NewerOlder