Last updated: May 21, 2026, 4:00 PM
Un-tit-led

ni6hant's Developer Notebook

Basic

Git

Android

General

Flutter

Python

Java

Archived to sort



VS CODE
Flask Flaskflask run command creates an application on the local server which you can access by visiting 127.0.0.1:5000 but it can’t be deployed to the server directly this way maybe because you can’t route to that location online.

Make a Github Repo and clone it

Open the Local Copy with VS Code

Make Virtual Environment

python -m venv venv

Activate Virtual Environment

.\venv\Scripts\activate

Upgrade pip

(venv)python -m pip install --upgrade pip

Install Flask

(venv)pip install flask

Install Gunicorn for deploying online

(venv)pip install gunicorn

Install python dot env

(venv)pip install python-dotenv

Extract requirements

(venv)pip freeze > requirements.txt

Edit requirements.txt:

Change == to <=

Make .gitignore file with the contents:

venv/

__pycache__

Make app.py file in root

from flask import Flask, render_template, request

app = Flask(__name__)

@app.route("/")

def index():

    return render_template('index.html')

Make templates folder and index.html

Basic HTML file.

Get out of Virtual Environment

(venv)deactivate

Test and Debug Your Code

flask run

Push Code to Github

and publish branch

Go to Render.com and add your code as Web Service

Select your branch

In the start command put
(Since we named our app app and the file app) and Create Web Service

gunicorn 'app:app'

yield vs. return

SQLAlchemy has a Connection Pooling mechanism by default. That means with yield you are creating a single session for each request. When you use return you are using a single database connection for all your app.

https://stackoverflow.com/questions/64763770/why-we-use-yield-to-get-sessionlocal-in-fastapi-with-sqlalchemy


FastAPI


Database/Postgress/JSON

0    

currencies    

        KWD    

            name    "Kuwaiti dinar"

            symbol    "د.ك"

def populate_countries():

        response = requests.get('https://restcountries.com/v3.1/all')

        data = response.json()

        for item in data:

                currencies = item.get('currencies', {})

                currency_data = next(iter(currencies.values()), {})

                currency_code = list(currencies)[0]


Unity and C# - abandoned due to new role

TODO

Common Screen Resolution:

Font Asset Creator for TextMeshPro TMP

View Post Alt+Shift Shortcut

Scroll Panel

In General Tips

Video Player Unity


Java - abandoned due to new job To Research Codility HyperSkill: Java for Beginners HackerRank - JAVA

Scanner scanner = new Scanner(System.in);

String myString = scanner.next();

int myInt = scanner.nextInt();

scanner.close();

System.out.println("myString is: " + myString);

System.out.println("myInt is: " + myInt);

// convert into int

        int value = (int)data;

A.compareTo(B);


CodeAcademy

Inheriting the constructor

Modifier

Class

Package

Child Class

Global

public

protected

no modifier

private

Learnt from Interview Tests

int[] finalArray = new int[finalRangeSize];

IDEs Apache Netbeans IDE 14 Soft Skills People Lie

Start considering the possibility that your senior/colleague might just be straight up lying about knowing something when they know nothing about it.

I have seen this happen a lot in my career. Instead of admitting that they don't know what they are talking about, they like to make up stuff and if you take their made-up stuff seriously, it will cause hours of frustration for you trying to conjure up a figment of their imagination to actual work.

#work #career