Skip to content

Instantly share code, notes, and snippets.

View SrejonKhan's full-sized avatar
🇵🇸
LET GAZA LIVE!

Srejon Khan SrejonKhan

🇵🇸
LET GAZA LIVE!
View GitHub Profile
@SrejonKhan
SrejonKhan / baiust_cse_dept_faculty.json
Created April 24, 2025 06:40
BAIUST CSE Dept Faculty JSON
{
"department": "Computer Science and Engineering",
"university": "Bangladesh Army International University of Science and Technology",
"faculty": [
{
"name": "Mohammad Asaduzzaman Khan",
"designation": "Associate Professor & Acting Dean, Faculty of ECE",
"email": "[email protected]",
"phone": "01711-003233"
},
@SrejonKhan
SrejonKhan / f_soln_baiust_jr_iupc_indi_24.cpp
Created May 24, 2024 11:00
Solution of Problem F from BAIUST Junior IUPC (Individual) 2024
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define sz(x) (int)(x).size()
#define trace(x) cerr << #x << " = " << x << '\n';
#define trace2(x,y) cerr << #x << "=" << x << "\t" << #y << "=" << y << '\n';
template<class T> T lcm(T a, T b) {return ( abs(a * b) / gcd(a, b));}
#define MOD (int)(1e9 + 7)
@SrejonKhan
SrejonKhan / baiust_semester_result_generator.js
Created May 12, 2024 18:51
Semester Result generator to generate bulk fake result with valid courses for respected semester.
function extractIdParts(id) {
if (id.length < 16) {
throw new Error("ID Length cannot be less than 16.");
}
const regex = /(\d{3})(\d{2})(\d{1})(\d{2})(\d{5})(\d{3})/;
const match = regex.exec(id);
if (!match) {
throw new Error("Invalid ID format");
@SrejonKhan
SrejonKhan / baiust_courses.json
Last active May 20, 2024 04:30
All courses of CSE in the new OBE System.
{
"totalBscCredit": 145,
"semesters": [
{
"semesterName": "First Semester",
"courses": [
{
"isSessional": false,
"courseCode": "CSE 113",
"courseTitle": "Discrete Mathematics",
@SrejonKhan
SrejonKhan / winston.logger.js
Created March 8, 2024 13:40
Winston Logger for General Purpose Logging (Overriding Console API), API Access Logging (WinstonExpress), API Error Logging (WinstonExpress) and Morgan Implementation to Winston Stream. ELK can be easily implemented.
const winston = require("winston");
const expressWinston = require("express-winston");
const config = require("./base");
/*-------------------GENERAL LOGGER-------------------*/
const generalLogger = winston.createLogger({
exitOnError: false,
format: winston.format.combine(winston.format.timestamp(), winston.format.json()),
transports: [
new winston.transports.File({ filename: "logs/error.log", level: "error" }),
@echo off
rem 1. Check if Python is installed
python --version > nul 2>&1
if %errorlevel% neq 0 (
echo Python is not installed. Installing Python...
start /wait python_installer.exe
)
rem 2. Add a specified path to environment and system variable
@SrejonKhan
SrejonKhan / update-unity-sdk.bat
Created June 2, 2022 16:08
A batch file to update android sdk platform-tools and build-tools for specific Unity Version. Credit - @skdev3
set UNITY_VERSION=%1%
c:
set JAVA_HOME=c:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\
set ANDROID_HOME=c:\Program Files\Unity\Hub\Editor\%UNITY_VERSION%\Editor\Data\PlaybackEngines\AndroidPlayer\
cd %ANDROID_HOME%SDK\tools\bin\
echo.> %USERPROFILE%\.android\repositories.cfg
cmd /C sdkmanager --update
cmd /C sdkmanager "platform-tools" "platforms;android-29"
@SrejonKhan
SrejonKhan / YouTubePlaylistToTSV.js
Created August 7, 2021 09:55
Run this in console of any YT Playlist to download all playlist video Title, Link in a TSV(Tab Seperated Value) file.
// if it doesn't get the actual list, copy new xPath from Elements
let conts = getElementByXpath("/html/body/ytd-app/div/ytd-page-manager/ytd-browse/ytd-two-column-browse-results-renderer/div[1]/ytd-section-list-renderer/div[2]/ytd-item-section-renderer/div[3]/ytd-playlist-video-list-renderer/div[3]");
let tsvData = "No.\t Title\t Link\n";
// loop through all contents
for(let i = 0; i < conts.childElementCount; i++) {
let cont = conts.childNodes[i].childNodes[3].childNodes[1].childNodes[3].childNodes[1].childNodes[3];
let link = "https://youtube.com" + cont.getAttribute("href").split('&')[0];
let title = cont.getAttribute("title");
@SrejonKhan
SrejonKhan / SnapClosest.cs
Created January 3, 2021 15:15
Snap gameobject to closest gameobject.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SnapClosest : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
//Snap();
@SrejonKhan
SrejonKhan / SmartRenovate.cs
Last active November 17, 2020 09:01
Smartly Update/Copy your important file(s)/Plugin(s) to your project from source.
/*
How-to:
Simply drag and drop in /Editor folder.
*/
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class SmartRenovate : EditorWindow
{