Redowan's Reflections
Recent writing
Learn how to use associative arrays in Bash to create key-value pairs, mimic dictionaries, and manage complex data structures in shell scripts.
Master techniques to remove duplicates from Python iterables while maintaining original order using sets, OrderedDict, and nested deduplication.
Use process substitution <() to treat command output as files in Bash. Compare directories, process data, and avoid temporary files with this technique.
Build interactive CLI menus with Bash select statement. Create user-friendly command-line tools with option selection and function dispatch.
Format terminal output with tput instead of ANSI codes. Set colors, bold text, underlines, and backgrounds with simple commands in shell scripts.
Create a client-side CSV comparison tool using ObservableHQ notebooks and ChatGPT. Learn to build interactive data apps without deployment hassles.
Stream real-time server updates to web clients using Server-Sent Events (SSE) as a simpler alternative to WebSockets for unidirectional data flow.
Build Unix domain socket servers and clients with Python and socat. Access Docker API via UDS, create HTTP servers, and optimize inter-process communication.
Gracefully shutdown Python's ThreadingTCPServer with signal handlers for SIGINT, SIGTERM handling and client notification on server shutdown.
Poll multiple data sources in a single thread using Python generators with itertools.cycle to alternate between infinite data streams efficiently.
Skip elements in iterables until a condition is met using itertools.dropwhile for efficient lazy evaluation that works with generators.
Build a pausable socket server with Python's socketserver module using threading for intermittent request handling and background tasks.
Connect Jupyter Notebook to Dockerized Django apps using ipykernel and django-extensions for interactive debugging and data exploration.
Use Django query expressions like Replace, Upper, Lower, Concat, and Substr for efficient database-level text manipulation without fetching data.
Display progress bars for concurrent Python tasks using tqdm with ThreadPoolExecutor and as_completed for real-time execution monitoring.