For example: We have a document like this one;
clubs:{
cid: 1,
cname: "Fenerbahce",
cplayers: [{
pid: 1,
class Service { | |
static async task(numv: number){ | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
console.log('Task completed ' + numv) | |
resolve(numv) | |
}, 3000) | |
}) |
import { StringDecoder } from 'string_decoder'; | |
import * as brotli from 'brotli'; | |
export class CompressionHelper { | |
static tryBrotliCompress(rawStringData: string): string { | |
const buf = Buffer.from(rawStringData, 'utf8'); | |
const bufBytes = new Uint8Array(buf) | |
const compressChunks = brotli.compress(bufBytes); | |
if(compressChunks === null) return Buffer.from(bufBytes).toString("base64"); |
import { Stack } from '@datastructures-js/stack'; | |
import { v4 as uuidv4 } from 'uuid'; | |
export class MessageStateHelper { | |
private static messagesStack = new Stack<string>(); | |
public static isAllMessagesCompleted(): boolean { | |
return this.messagesStack.isEmpty(); | |
} |
setsave "ui_forceenabletesting" "true" | |
startgame practice GameName map:caldavar allheroes:true devheroes:true nostats:true mode:botmatch norespawntimer:true easymode:true |
client | |
# specify server ip address here | |
remote <SERVER-IP> | |
dev tap | |
# name of the windows network connection | |
dev-node openVPN |
import { Injectable } from "@nestjs/common"; | |
import { TelemetryClient } from "applicationinsights"; | |
import { AvailabilityTelemetry, DependencyTelemetry, EventTelemetry, ExceptionTelemetry, Identified, MetricTelemetry, NodeHttpDependencyTelemetry, NodeHttpRequestTelemetry, PageViewTelemetry, RequestTelemetry, Telemetry, TelemetryType, TraceTelemetry } from "applicationinsights/out/Declarations/Contracts"; | |
const AZURE_APP_INSIGHTS_CONN_STRING = process.env.AZURE_APP_INSIGHTS_CONN_STRING | |
@Injectable() | |
export class ApplicationInsightsService { | |
private _instance: TelemetryClient |
import { Logger, Module } from '@nestjs/common'; | |
import { MongoClient } from 'mongodb'; | |
import { MongoProperty } from './mongo-property.interface'; | |
@Module({ | |
providers: [ | |
{ | |
provide: 'PAYMENT_DATABASE_CONNECTION', | |
useFactory: async (): Promise<MongoProperty> => { | |
const maxReconnectAttempts = 5; |
import { CustomSingletonLoggerService, DataAlreadyExistsError, LogDto, SingletonFlushSummaryLog, SingletonLoggerHelperService } from "@eqxjs/stub" | |
import { Injectable } from "@nestjs/common" | |
// export declare class LogDto { | |
// appName?: string; | |
// componentVersion?: string; | |
// componentName?: string; | |
// broker?: string; | |
// channel?: string; | |
// useCase?: string; |
#!/bin/bash | |
# Define the Kafka broker and topic | |
BROKER_LIST="localhost:9092" | |
TOPIC="mfaf.exampleTopic" | |
# Loop to simulate load test | |
while true; do | |
# Generate some random JSON data and save it to a file | |
# echo "{\"key\": \"value\"}" > m.json |