Skip to content

Instantly share code, notes, and snippets.

View rajivnarayana's full-sized avatar

Rajiv Narayana Singaseni rajivnarayana

View GitHub Profile

Implement the following simple addition game (2 digits) using React.

Game-480p.mov

Following things are important.

  1. The total questions will be 10.
  2. The answers should not cross 100.
  3. The questions should not be hardcoded and should change for each and every game.
  4. All the answers must be present in the options below.
@rajivnarayana
rajivnarayana / Problem.md
Created April 1, 2022 07:52
Bank Balance Sample Project

Technologies used.

  1. MUI
  2. Formik
  3. React router
  4. Redux

Home page should have the current balance. home

@rajivnarayana
rajivnarayana / main.js
Created March 21, 2022 05:41
Webhook to grab user creation event
const express = require("express");
const bodyParser = require('body-parser');
// create application/json parser
const jsonParser = bodyParser.json();
const app = express();
app.use(jsonParser);
app.post("/webhooks/users/create", (req, res) => {
res.status(200).send("OK");
@rajivnarayana
rajivnarayana / README.MD
Created February 11, 2022 16:20
A No dependency http proxy

A http proxy with no dependencies running on default port 4000.

Proxy

Any request to /licipoapi/proxy will be proxied to the destination end point. Request body should have to be wrapped in data variable and the url should also be passed in the body.

{
  "data" : <...actual body...>,
 "url": "https://original-url.example.com"
@rajivnarayana
rajivnarayana / requests.ts
Created January 20, 2022 11:59
A No dependency NodeJS requests library.
import FormData from "form-data";
import { APIError } from "../utils/api-error";
const querystring = require("querystring");
function onRequestComplete(resolve, reject) {
return (res) => {
const contentType = res.headers.hasOwnProperty("content-type")
? { "application/json": "json", "text/xml": "xml" }[
res.headers["content-type"]
] || "binary"
@rajivnarayana
rajivnarayana / GuessingGame.md
Last active February 2, 2023 06:07
Number Guessing Game

1 Start

You can start guessing and you would find out if your guess was higher or lower than the chosen number.

Example: if the chosen number was 43 and your guesses were

Guess Description
50 Try lower
@rajivnarayana
rajivnarayana / sudoku.md
Last active October 12, 2022 11:43
Sudoku sample question

Write a function that receives a completed Sudoku board as parameter and returns either Finished if the Sudoku is done correctly or Try again! if not.
The board received an array of 9 subarrays as a parameter. These are the board's rows.

Sudoku rules

  • There are 9 rows in a traditional Sudoku puzzle. There may not be any duplicate numbers in any row. Each row must be unique.
  • The are 9 columns in a traditional Sudoku puzzle. There may not be any duplicate numbers in any column. Each column must be unique.
  • A region is a 3x3 box. There are 9 regions in a traditional Sudoku puzzle. There may not be any duplicate numbers in any region. Each region must be unique.
  • Every row, column and region contains the numbers one through nine only once.
@rajivnarayana
rajivnarayana / addition-express.js
Created July 1, 2021 11:26
Simple express server to add 2 numbers
const express = require("express");
const bodyParser = require('body-parser');
const app = express();
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }))
app.get("/", (req, res) => {
res.status(200).send(`<h2>Guessing game</h2>
Click here to get <a href="/addition">started</a>
@rajivnarayana
rajivnarayana / game.html
Created June 18, 2021 13:27
Hero Animation on a canvas.
<canvas id="canvas" width="400" height="600"></canvas>
<script src="./game.js"></script>-
/**
* Write a program to encode a given number in roman numeral form
// I - 1
// V - 5
// X - 10
// L - 50
// C - 100
// D - 500
// M - 1000
@param {*} number