This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |