Skip to content

Instantly share code, notes, and snippets.

View 22f2000147's full-sized avatar
💻
Building

PURNENDU SHUKLA 22f2000147

💻
Building
View GitHub Profile
@22f2000147
22f2000147 / index,js
Created April 11, 2024 12:59
Complete code for : Reclaiming User's Identity With Affinidi
// 1. Import required Libraries
const express = require('express');
const passport = require('passport');
const session = require('express-session');
const { Issuer, Strategy } = require('openid-client');
const http = require("http");
require("dotenv").config();
// 2. Create an express application and setup session
const app = express();
@22f2000147
22f2000147 / readme.md
Created May 8, 2024 08:40
Load model using sklearn and use in javascript. Assuming you already have and model

Here are the steps on how to save a model in Python using scikit-learn and use it in JavaScript:

  1. Save model using joblib
import joblib

# Save the model
joblib.dump(model, "model.pkl")
@22f2000147
22f2000147 / grad.py
Created May 13, 2024 13:09
gradient descent complete code from scratch!
import numpy as np
# create the gradient decent fn
def gradient_descent(x, y):
m_curr = b_curr = 0 #m and b current values
iters = 1000
lr = 0.009 #move on
n = len(x)
for i in range(iters):
y_pred = m_curr * x + b_curr #mx+b
@22f2000147
22f2000147 / Instructions.txt
Created September 27, 2024 05:50
Helps creating a mall shopping dataset
Apply the following transformations. (maybe lambda can help):
Gender: Encoded as 0 for Male and 1 for Female.
ProductCategory: Encoded as 1 for Electronics, 2 for Clothing, 3 for Groceries, and 4 for Cosmetics.
PaymentMethod: Encoded as 1 for Credit Card, 2 for Cash, and 3 for Debit Card.
MallBranch: Encoded as 1 for North, 2 for East, and 3 for West.
Keep rest columns as it is and dont create a new data frame
@22f2000147
22f2000147 / deepseek_v3_res.py
Created March 25, 2025 10:46
3D Particle Simulations
import numpy as np
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
import random
import time
class Particle:
def __init__(self, position, velocity, color, size, lifetime=10.0):
@22f2000147
22f2000147 / claude_sonnet_3.7_game_results.py
Last active March 26, 2025 09:15
Simple Minecraft game using Pygame in Python.
# fixed code
import pygame
import random
# Initialize Pygame
pygame.init()
# Screen settings
SCREEN_WIDTH, SCREEN_HEIGHT = 800, 600