Skip to content

Instantly share code, notes, and snippets.

View abhishekjkrsna's full-sized avatar

Abhishek Jhingran abhishekjkrsna

  • Varion Advisors Analytics
  • Lucknow
  • 20:26 (UTC +05:30)
View GitHub Profile
@abhishekjkrsna
abhishekjkrsna / lambda_comprehend
Created May 3, 2024 15:30
perform sentiment analysis using aws comprehend.
import json
import boto3
comprehend = boto3.client("comprehend")
def check_validity(event):
"""Check if the event has the required fields"""
try:
if "text" not in event or "lang_code" not in event:
@abhishekjkrsna
abhishekjkrsna / buildspec.yml
Created April 8, 2024 10:58
buildspec.yml file for a React App using yarn for aws code build
version: 0.2
phases:
install:
runtime-versions:
nodejs: 20.x
commands:
- echo "Install Phase"
- npm install --global yarn
- yarn
@abhishekjkrsna
abhishekjkrsna / docker_image.md
Last active April 8, 2024 09:59
docker container for a react app

Docker Image for React App

Screenshot_7-4-2024_20220_localhost

A simple demonstration of containerizing a react app

Prerequisites

  • Node.js
  • NGINX
@abhishekjkrsna
abhishekjkrsna / serverless.md
Created April 1, 2024 05:40
Building Scalable E-commerce Order Processing Microservice with a Serverless Fan-Out Architecture

fanout-architecture (1)

In the fast-paced world of e-commerce, a robust and scalable order processing system is crucial for success. Serverless architectures on AWS provide the power and flexibility to handle fluctuating demands while minimizing operational overhead. In this post, we'll explore how to design a serverless fan-out architecture using SNS, SQS, and Lambda to achieve efficient e-commerce order handling.

The Fan-Out Pattern: Why It Matters for E-commerce

The fan-out pattern allows a single event or message to be processed by multiple downstream services simultaneously. For order processing, this is a potent strategy. When an order is placed, parallel processes need to occur:

  • Customer Notifications: Emails, SMS updates, etc., must be sent.
  • Inventory Updates: Deducting stock to avoid overselling.
@abhishekjkrsna
abhishekjkrsna / 3-tier-application.md
Created March 30, 2024 16:32
Learn how I built a scalable and secure application using a 3-tier architecture on AWS.

Simple 3 tier Application

In today's digital landscape, building robust and scalable applications is crucial. For my latest project, I opted for a 3-tier architecture on AWS, and I'm excited to share the details with you! This architecture offers a clean separation of concerns, making the application easier to maintain, secure, and ultimately, more efficient. ###What is a 3-Tier Architecture? Imagine a well-oiled machine with three distinct parts working together seamlessly. That's the essence of a 3-tier architecture. Here's a breakdown of the tiers in my AWS implementation:

  • Presentation Tier: This is the frontline, handling user interactions. It can be a web application, a mobile app, or even a desktop application. In my case, [insert details about your presentation tier - web application built with React, mobile app built with Kotlin, etc.].
  • Application Tier (Business Logic Tier): The brains behind the operation! This ti
@abhishekjkrsna
abhishekjkrsna / sentiment-analysis.md
Created March 28, 2024 11:50
Use my Sentiment Analyzer App for sentiment and also intent analytsis

Screenshot_28-3-2024_171641_partyrock aws

Link for the app: https://partyrock.aws/u/abjkrsna/8hoiG7w8h/Sentiment-Analyzer

Steps for Sentiment Analysis:

  1. The App has three section: input text, text summary and sentiment analysis.
  2. In the input text section, enter the text for analsysis.
  3. In the text summary section a analysis for the text is provided.
  4. In the sentiment analysis section the sentiment and intent analysis of the text is provided.
@abhishekjkrsna
abhishekjkrsna / rock-paper-scissor.py
Created March 15, 2024 12:10
Rock Paper Scissor game in python
class Participant:
def __init__(self, name):
self.name = name
self.points = 0
self.choice = ""
def choose(self):
self.choice = input("{name}, select rock, paper or scissor: ".format(name= self.name))
print("{name} selects {choice}".format(name=self.name, choice = self.choice))
"""
Maximum Sum BST
Given a binary tree root, the task is to return the maximum sum of all keys of any sub-tree which is also a Binary Search Tree (BST).
Input Format:
The first and only line of input contains data of the nodes of the tree in level order form. The order is: data for root node, data for left child to root node, data for right child to root node and so on and so forth for each node. The data of the nodes of the tree is separated by space. Data -1 denotes that the node doesn't exist.
Output Format:
Print the maximum sum
Sample Input 1:
1 4 3 2 4 2 5 ## Write your code here
-1 -1 -1 -1 -1 -1 4 6 -1 -1 -1 -1