Reddit Programming
211 subscribers
1.22K photos
124K links
I will send you newest post from subreddit /r/programming
Download Telegram
Open Source as Career Catalyst
https://www.reddit.com/r/programming/comments/1o8n320/open_source_as_career_catalyst/

<!-- SC_OFF -->Contributing to #opensource can shape your skills, strengthen your professional identity, and open doors you didn’t even know existed. Do you have examples of how open source has helped your career? <!-- SC_ON --> submitted by /u/WalrusOk4591 (https://www.reddit.com/user/WalrusOk4591)
[link] (https://www.punch-tape.com/blog) [comments] (https://www.reddit.com/r/programming/comments/1o8n320/open_source_as_career_catalyst/)
Dialogs that work everywhere – dealing with the timeout
https://www.reddit.com/r/programming/comments/1o8z31v/dialogs_that_work_everywhere_dealing_with_the/

<!-- SC_OFF -->Miniterface (https://github.com/CZ-NIC/mininterface) is a toolkit that makes dialogs that work everywhere, as a desktop, terminal, or a browser app. Recently, I've added a timeout feature that auto-confirms the dialog in few seconds. As the library guarantees the dialogs work the same way everywhere, this was technically challenging, take a look at the techniques used for each interface. GUI (tkinter) I feared this will be the most challenging, but in the contrary! Simply calling the countdown method, while decreasing the time to zero worked. In the method, we use the tkinter after to set another timeout self.after_id = self.adaptor.after(1000, self.countdown, count - 1) and changed the button text self.button.config(text=f"{self.orig} ({count})"). When countdown is at the end, we click the button via self.button.invoke(). The moment user defocuses the button, we stop the counting down. self.button.bind("", lambda e: self.cancel() if e.widget.focus_get() else None) Do you see the focus_get? This is to make sure another widget in the app has received the focus, we don't want to stop the counting down on changing the window focus via Alt+tab. https://github.com/CZ-NIC/mininterface/blob/main/mininterface/_tk_interface/timeout.py TUI (textual) The TUI interface is realized via the textual (https://textual.textualize.io/) framework. On init, we create an async task asyncio.create_task(self.countdown(timeout)), in which there is a mere while loop. The self.countdown method here is called only once. while count > 0: await asyncio.sleep(1) count -= 1 self.button.label = f"{self.orig} ({count})" As soon as while ends, we invoke the button (here, the invocation is called 'press') via self.button.press(). https://github.com/CZ-NIC/mininterface/blob/main/mininterface/_textual_interface/timeout.py text interface The fallback text interface uses a mere built-in input(). Implementing counting down here was surprisingly the most challenging task. As we need to stop down counting on a keypress (as other UIs do), we cannot use the normal input but meddle with the select or msvcrt packages (depending on the Linux/Win platform). The counting is realized via threading, we print out a dot for every second. It is printed only if input_started is false, no key was hit. if not input_started.is_set(): print(".", end='', flush=True) The code is the lengthiest: https://github.com/CZ-NIC/mininterface/blob/main/mininterface/_text_interface/timeout.py Conclusion Now, the programmer can use the timeout feature on every platform, terminal, browser, without actually dealing with the internal implementation – threading, asyncio, or mainloop. This code runs everywhere: from mininterface import run m = run() print(m.confirm("Is that alright?"), timeout=10) # True/False <!-- SC_ON --> submitted by /u/the-e2rd (https://www.reddit.com/user/the-e2rd)
[link] (https://cz-nic.github.io/mininterface/Mininterface/#mininterface.Mininterface.confirm) [comments] (https://www.reddit.com/r/programming/comments/1o8z31v/dialogs_that_work_everywhere_dealing_with_the/)
Zip file cracking
https://www.reddit.com/r/programming/comments/1o9pe9u/zip_file_cracking/

<!-- SC_OFF -->Hi everyone! I have a really frustrating problem. An old colleague of mine thought that it would be funny to encrypt one of our old zip files. He is not willing to share the password, the only information I know is that it is a hexadecimal color code. I tried a few thing, but I just can't crack it. Unfortunately I am very stubborn and I don't like to give up. So I really need some help with it. If you have any specific tips, or know a way please tell me. If you message me, I can share the file. Me and my other colleagues offer 12 USD to anyone who can crack it. Thanks :) <!-- SC_ON --> submitted by /u/Frosty-Letterhead-37 (https://www.reddit.com/user/Frosty-Letterhead-37)
[link] (http://en.wikipedia.org/wiki/john_the_ripper) [comments] (https://www.reddit.com/r/programming/comments/1o9pe9u/zip_file_cracking/)
Blinter The Linter - A Cross Platform Batch Script Linter
https://www.reddit.com/r/programming/comments/1o9qp1x/blinter_the_linter_a_cross_platform_batch_script/

<!-- SC_OFF -->Yes, it's 2025. Yes, people still write batch scripts. No, they shouldn't crash. What It Does 158 rules across Error/Warning/Style/Security/Performance
Catches the nasty stuff: Command injection, path traversal, unsafe temp files
Handles the weird stuff: Variable expansion, FOR loops, multilevel escaping
10MB+ files? No problem. Unicode? Got it. Thread-safe? Always. Get It Now bash pip install Blinter Or grab the standalone .exe from GitHub Releases (https://github.com/tboy1337/Blinter/releases/latest) One Command bash python -m blinter script.bat That's it. No config needed. No ceremony. Just point it at your .bat or .cmd files. The first professional-grade linter for Windows batch files.
Because your automation scripts shouldn't be held together with duct tape. 📦 PyPI (https://pypi.org/project/Blinter/) • ⚙️ GitHub (https://github.com/tboy1337/Blinter) <!-- SC_ON --> submitted by /u/Ok_Bottle8789 (https://www.reddit.com/user/Ok_Bottle8789)
[link] (https://github.com/tboy1337/Blinter) [comments] (https://www.reddit.com/r/programming/comments/1o9qp1x/blinter_the_linter_a_cross_platform_batch_script/)
Coding best practices you should follow as a software developer
https://www.reddit.com/r/programming/comments/1o9voh7/coding_best_practices_you_should_follow_as_a/

<!-- SC_OFF -->Hey everyone! 👋 I’ve been learning more about clean code practices and recently dove into the Single Responsibility Principle (SRP). It’s one of those things that sounds simple at first but can completely change how you structure your classes and functions. I wrote a Medium article breaking it down with examples and some practical tips on how to avoid the “spaghetti code” feeling:
https://medium.com/@harshalgadhe/the-single-responsibility-principle-srp-explained-why-your-code-still-stinks-and-how-to-fix-it-3193c88722ab I’d love to hear what you think about it, and if you have any tips or examples of how SRP has helped you in your projects, I’m all ears! Happy coding! 🚀 <!-- SC_ON --> submitted by /u/Feeling_Lettuce7476 (https://www.reddit.com/user/Feeling_Lettuce7476)
[link] (https://medium.com/@harshalgadhe/the-single-responsibility-principle-srp-explained-why-your-code-still-stinks-and-how-to-fix-it-3193c88722ab) [comments] (https://www.reddit.com/r/programming/comments/1o9voh7/coding_best_practices_you_should_follow_as_a/)
Spec-Driven AI Toolkit
https://www.reddit.com/r/programming/comments/1o9yivq/specdriven_ai_toolkit/

<!-- SC_OFF -->A new approach given by GitHub to leverage AI and agentic tools to complete your work smarter by Spec Kit (open-source) to transform requirements into actionable blueprints, streamlining development, and raising code quality for your team. <!-- SC_ON --> submitted by /u/abdelrhman-arnos (https://www.reddit.com/user/abdelrhman-arnos)
[link] (https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/) [comments] (https://www.reddit.com/r/programming/comments/1o9yivq/specdriven_ai_toolkit/)