Skip to content

Instantly share code, notes, and snippets.

@jranil
jranil / ps-file-merger.ps1
Created March 19, 2025 12:51
PowerShell script that creates a comprehensive project snapshot by generating a single text file containing directory structure and file contents. Useful for code reviews, documentation, and sharing project snapshots without version control.
# Get current date in YYYY-MM-DD format
$currentDate = Get-Date -Format "yyyy-MM-dd"
# Get the current folder name
$currentFolderName = Split-Path -Path (Get-Location).Path -Leaf
# Define output file path one folder above the current location with date prefix
$parentFolder = Split-Path -Path (Get-Location).Path -Parent
$outputFile = Join-Path -Path $parentFolder -ChildPath "$currentDate-$currentFolderName`_merged.txt"
@jranil
jranil / TeamTrack.py
Created April 5, 2025 15:05
A Python script that generates a comprehensive Excel/Google Sheets Kanban-style task tracking (To Do, In Progress, Blocked, Done) compatible task tracking system with automated dashboards.
import pandas as pd
import os
from datetime import datetime, timedelta
import openpyxl
from openpyxl.styles import PatternFill, Font, Alignment, Border, Side
from openpyxl.utils import get_column_letter
from openpyxl.chart import BarChart, Reference, LineChart
from openpyxl.worksheet.datavalidation import DataValidation
@jranil
jranil / reset_to_minimal.sh
Created March 23, 2026 22:20
"reset" a ubuntu server to a minimal state without doing a full reinstall
#!/bin/bash
set -e
echo "=== Step 1: Preserve critical configs ==="
# Backup SSH and network configs
cp -r /etc/ssh /root/ssh_backup
cp -r /etc/netplan /root/netplan_backup 2>/dev/null || true
cp /etc/network/interfaces /root/interfaces_backup 2>/dev/null || true
echo "=== Step 2: Stop and disable non-essential services ==="
@jranil
jranil / Crowd_Estimator_polygons.py
Created July 6, 2026 16:56
Crowd Estimator using OSM & Folium
"""
Advanced Crowd Estimator — robust OSM land-use analysis
"""
import json, time, webbrowser, requests
from threading import Timer
from flask import Flask, request, jsonify, render_template_string
from pyproj import Geod, Transformer
from shapely.geometry import Polygon, LineString
from shapely.ops import unary_union, transform as shp_transform