Skip to content

Instantly share code, notes, and snippets.

View cs-mshah's full-sized avatar
🎯
Focusing

Manan Shah cs-mshah

🎯
Focusing
View GitHub Profile
@pszemraj
pszemraj / async_pipeline.py
Last active August 6, 2025 17:08
Standalone Asynchronous RolmOCR Inference Script using vLLM and PyMuPDF.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Standalone Asynchronous RolmOCR Inference Script using vLLM and PyMuPDF.
This script processes PDF files from an input directory using the
reducto/RolmOCR model served locally by vLLM via its OpenAI-compatible API.
It renders each page, sends API requests concurrently for OCR, extracts plain
text, and saves the combined text for each PDF into a corresponding .txt file
in the specified output directory.

Security Checklist (What can be done in CursorAI & software-level not infrastructure!)

Configuration Security

  • Detect secrets in code
  • Identify secrets committed to version control
  • Flag hardcoded credentials

Authentication & Authorization

  • Identify missing authentication checks
  • Detect improper authorization patterns
@rasbt
rasbt / video-subtitles-via-whisper.py
Last active March 20, 2025 13:55
Script that creates subtitles (closed captions) for all MP4 video files in your current directory
# Sebastian Raschka 09/24/2022
# Create a new conda environment and packages
# conda create -n whisper python=3.9
# conda activate whisper
# conda install mlxtend -c conda-forge
# Install ffmpeg
# macOS & homebrew
# brew install ffmpeg
# Ubuntu
# lazyload nvm
# all props goes to http://broken-by.me/lazy-load-nvm/
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/
lazynvm() {
unset -f nvm node npm npx
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f "$NVM_DIR/bash_completion" ]; then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion