Skip to content

Instantly share code, notes, and snippets.

View tirthankarkundu17's full-sized avatar
🎯
Focusing

Tirthankar Kundu tirthankarkundu17

🎯
Focusing
View GitHub Profile
<?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>in.bitmaskers</groupId>
<artifactId>grpc-server</artifactId>
<version>1.0-SNAPSHOT</version>
@tirthankarkundu17
tirthankarkundu17 / jsonplaceholder-api.raml
Last active May 9, 2021 15:35
JSON Placeholder RAML
#%RAML 1.0
title: jsonplaceholder-api
/posts:
get:
responses:
200:
body:
application/json:
example: |
@tirthankarkundu17
tirthankarkundu17 / tailFactorial.dwl
Last active January 28, 2021 12:00
Tail Recursion in Dataweave2
%dw 2.0
fun tailFactorial(n:Number, prod:Number = 1) =
(if(n == 1 or n == 0)
prod
else
tailFactorial(n-1, (prod * n)))
output application/json
---
tailFactorial(5)
%dw 2.0
fun factorial(n: Number) =
(if(n == 0 or n == 1)
1
else
n * factorial(n-1))
output application/json
---
factorial(10)
@tirthankarkundu17
tirthankarkundu17 / Dockerfile
Last active May 9, 2020 07:10
Docker File for NGINX
FROM nginx
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
@tirthankarkundu17
tirthankarkundu17 / server.js
Last active May 9, 2020 04:51
A small NODEJS server app
const dotenv = require("dotenv"); // Read from .env file
const express = require("express");
dotenv.config();
const app = express();
const appid = process.env.PORT;
app.get("/", (req, res) => res.send(`Hi from appid: ${appid}`));
app.listen(appid, () => console.log(`Application : ${appid} is listening on port ${appid}`));
@tirthankarkundu17
tirthankarkundu17 / Dockerfile
Last active May 9, 2020 04:46
Docker file for NODE Server
FROM node:12
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
CMD node app.js
EXPOSE 3500