Skip to content

Instantly share code, notes, and snippets.

@iamargentum
iamargentum / test.js
Created December 14, 2023 11:21
auth exclusion snippet
// endpoints that do not need authentication
// "/_next" endpoint for development server
const unauthenticated_endpoints = [
// next auth routes
"/api/auth", "/_next",
// client side routes
"/products", "/services", "/generate"
];
// for endpoints that don't need authentication, just pass
@iamargentum
iamargentum / zero.py
Created December 3, 2022 18:18
this program finds the lowest unused number from an array
someArray = [0, 1, 3]
contextSmallest = someArray[0] # considering the first element of the aray to be smallest
for i in range(1, len(someArray)): # finding the actual smallest number
if someArray[i] < contextSmallest:
contextSmallest = someArray[i]
smallestUnused = None # let's say
while smallestUnused is None:
from flask import Flask, request
app = Flask(__name__)
@app.route("/data-echo", methods=['POST'])
def echo():
data = request.get_json()
print("received data is ", data)
return data
import socket
from threading import Thread
class Proxy2Server(Thread):
def __init__(self, host, port):
super(Proxy2Server, self).__init__()
self.client = None #client socket not known yet
self.port = port
self.host = host
@iamargentum
iamargentum / one.py
Last active September 15, 2021 21:02
solution for the stl slicing problem with program names corresponding to the question numbers
import trimesh
from time import sleep
from savePlot import saveSection
myMesh = trimesh.load_mesh('assignment.stl')
height = int(input('please input height - '))
# hard coded base plane (bottom)
saveSection(2, height, myMesh)