This file contains hidden or 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
| import { Table, is, getTableName } from "drizzle-orm"; | |
| import { Cache } from "drizzle-orm/cache/core"; | |
| import type { CacheConfig } from "drizzle-orm/cache/core/types"; | |
| import { createClient, type RedisClientType } from "redis"; | |
| // Initialize Redis client | |
| export const redis: RedisClientType = createClient({ | |
| url: "redis://localhost:6379", | |
| }); | |
| redis.connect().catch((err) => console.error("Redis connection error:", err)); |
This file contains hidden or 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 admin = require('firebase-admin'); | |
| const elasticsearch = require('elasticsearch'); | |
| // Config before running | |
| const CONFIG = { | |
| limit: 1000, // reduce if got Deadline exceeded error | |
| index: 'stock', | |
| type: 'doc', | |
| dev: { | |
| serviceAccountJson: './devServiceAccount.json', |
This file contains hidden or 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
| function arrayClone(arr) { | |
| var len = arr.length; | |
| var copy = new Array(len); | |
| for (var i = 0; i < len; i++) { | |
| copy[i] = arr[i]; | |
| } | |
| return copy; | |
| } |
This file contains hidden or 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 h = require('../helper'); | |
| const async = require('async'); | |
| const MongoClient = require('mongodb').MongoClient; | |
| const collections = { | |
| World: null, | |
| Fortune: null | |
| }; | |
| MongoClient.connect('mongodb://tfb-database/hello_world?maxPoolSize=5', (err, db) => { | |
| // do nothing if there is err connecting to db |
This file contains hidden or 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
| function merge(arr1, arr2){ | |
| const arr1ById = arr1.reduce((map, next) => (map[next.id] = next, map), {}); | |
| const byId = arr2.reduce((map, next) => (map[next.id] = next,map), arr1ById); | |
| //const byId = arr2.reduce((map, next) => arr1ById); | |
| // resta el 2do elemento arr[1] | |
| //return Object.entries(byId).map((arr) => arr[1]); | |
| var asd = Object.entries(byId).map((arr) => arr[1]); | |
| return asd[1].total; | |
| } | |
| // actualiza valores teniendo en cuenta el id |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>ato</groupId> | |
| <artifactId>mix</artifactId> | |
| <version>1.0-SNAPSHOT</version> |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>red</groupId> | |
| <artifactId>d</artifactId> | |
| <version>1.0-SNAPSHOT</version> |