Skip to content

Instantly share code, notes, and snippets.

View ninadpchaudhari's full-sized avatar
:shipit:

Ninad P.Chaudhari ninadpchaudhari

:shipit:
View GitHub Profile

Jest Assignment: JavaScript Queue

Project Description

This repository contains a JavaScript implementation of a Queue data structure inspired by Princeton's Intro to Programming. You are the developer and must write robust unit tests using Jest.

Bug: The dequeue() method does not throw an error when called on an empty queue. This violates expected behavior and must be caught through testing.


@ninadpchaudhari
ninadpchaudhari / readme.md
Created April 21, 2025 04:11
Gist on the Tuya Integration for Category "dr" (Heated Blanket) Integration

The Heated Blanket Integration

The documentation about this device on Tuya's developer docs is old, but their device control API can be used to see all about the category.

Exploring the specific case of Sunbeam heated mattress

  • The device follows the instruction set of "dr"
  • It has a product id of : ebb820c3cd7beefe10lhkg
  • It supports a superset of Standard Instruction set, which are not crucial and can be implemented by someone later if required.
@ninadpchaudhari
ninadpchaudhari / back.Dockerfile
Created April 9, 2025 21:43
Idealy you should use npm build to generate static files from your frontend and have them deployed, but for now, feel free to use this Dockerfile as a reference
FROM node:22 as build
WORKDIR /app
COPY package.json /app/package.json
COPY package-lock.json /app/package-lock.json
RUN npm install
COPY . /app
package edu.siena;
import java.util.List;
public class CartProcessor {
public static double calculateTotal(List<Double> prices) {
double total = 0.0;
for (int i = 0; i <= prices.size(); i++) {
total += prices.get(i);
}

Nodejs and Serverside

Install Nodejs and NPM

  • Already installed on Github Codespaces

  • On your local machine, you can install Nodejs and NPM using the package manager of your choice.

  • Example on MacOS, you can use Homebrew: brew install node

  • On Windows, you can download the installer from the Nodejs website.

  • On Windows, you can also use the Windows Subsystem for Linux (WSL) to install Nodejs and NPM using the Linux instructions above.

public class ConditionalLoopExample {
public static void main(String[] args) {
int x = 0;
while (x < 5) {
if (x % 2 == 0) {
System.out.println(x + " is even");
} else {
System.out.println(x + " is odd");
}
x++;
@ninadpchaudhari
ninadpchaudhari / nginx_conf.partial
Created March 14, 2025 04:21
Only required headers for KF
# WebSocket proxying
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
server_name examplecat.com;
location / {
# Backend nodejs server
#for uploading
import requests
from math import *
from JES import *
# Ahyaan Malik - Animation Project - CSIS 110 - 12/4/2024
# Create an animation using exactly 1 for loop
# BONUS - I decided to make a music video out of this, with cool effects and many, MANY moving objects
# BONUS - MANY if statements were used, keep scrolling if you like that, stop scrolling if you don't
# BONUS - Many measures were taken to ensure correct syncing of the song, guessing won't cut it!
# BONUS - Created 3 extra functions, a copyInto function that removes the white off jpgs, a function to increase the r g b values of any pic by any amount, and a way to detect a certain color and change that color, for rainbow text.
# The blob was also created to bounce up and down as it goes, he'll be back soon
@ninadpchaudhari
ninadpchaudhari / sound_collage.py
Created November 14, 2024 04:01
Temporarily hosted for Ahyaan
# Ahyaan Malik - Submitted 11/10/24
# Resubmitted 11/11/24 due to extra time - Added two new sounds for less awkwardness, improved rick roll by adding a new bass then blended that bass
# Sound Collage - Creates an audio collage with various effects
# Professor Chaudhari
# There are 2 original segments, a modification for each of those 2 segments (2 for the 2nd one), 1 segment that isn't modified, and the rick roll created.
# Each segment, original or modified, is placed in an empty sound file with just the right amount of samples
# Each segment is separated by 0.5 seconds
@ninadpchaudhari
ninadpchaudhari / main.py
Created October 23, 2024 00:54
Ahyaan Malik - Submitted 10/15/24 Temporarily hosted here
from JES import *
from random import *
# Ahyaan Malik - Submitted 10/15/24
# Creates a "graffitied" image from a jpg of dwayne the rock johnson
# His eye (pupil specifically), head, and teeth color were randomly changed
# Additionally, a bar of solid color was added with text, and all of this was placed onto a wall
# EXTRA POINTS - the many texts added to the back may simply seem only weird, but their placements are random! Random positions (I specifically made sure to not have them be covered by dwayne) and random sizes with differing shades of purple!