Skip to content

Instantly share code, notes, and snippets.

View duttaANI's full-sized avatar

Aniruddha Dutta duttaANI

View GitHub Profile
@duttaANI
duttaANI / mydaemon.cpp
Created January 3, 2024 18:58
Rabbit MQ communication between threads
#include <iostream>
#include <thread>
#include <amqp.h>
#include <amqp_tcp_socket.h>
#include <functional> // Include this header for std::ref
const std::string QUEUE_NAME = "hello_queue";
const std::string EXCHANGE_NAME = "hello_exchange";
const std::string ROUTING_KEY = "hello_routing_key";
@duttaANI
duttaANI / client_server.js
Created December 26, 2023 14:26
docker network
// client_server.js
const express = require('express');
const axios = require('axios');
const app = express();
const port = 4000;
app.get('/getdata', async (req, res) => {
try {
// Make a request to the API server using its container name
@duttaANI
duttaANI / api_server.js
Created December 26, 2023 14:22
docker_network
// api_server.js
const express = require('express');
const app = express();
const port = 3000;
app.get('/api/data', (req, res) => {
res.json({ message: 'Hello from API server!' });
});
@duttaANI
duttaANI / csr_matrix.h
Created February 9, 2022 15:23
Code to convert a given matrix to CSR format
#include <iostream>
#include <stdlib.h>
#include <cstdlib>
#include <vector>
#include <math.h>
#include <cuda.h>
#include <cuda_runtime.h>
using namespace std;
class CSR
@duttaANI
duttaANI / Dockerfile
Created January 23, 2022 23:46
Dockerfile for the-one simulator : https://github.com/akeranen/the-one
FROM adoptopenjdk/openjdk8
WORKDIR /app
COPY . /app
RUN ./compile.sh
RUN ls
@duttaANI
duttaANI / getEvent.js
Created July 4, 2021 10:28
Realm backend2
// Initializing stitch
const {
Stitch,
RemoteMongoClient,
ServerApiKeyCredential
} = require('mongodb-stitch-server-sdk');
// call env path
@duttaANI
duttaANI / insertEvent.js
Last active July 4, 2021 10:33
Realm backend
// Initializing stitch
const {
Stitch,
RemoteMongoClient,
ServerApiKeyCredential
} = require('mongodb-stitch-server-sdk');
// call env path
require('dotenv').config({ path: '../../.env' });