Code Snippet Weekly

Useful code snippets you can use today. | 2026-07-31

THE BIG ONE

How to Automate Ubuntu Server Hardening with One Script — Securing a cloud server can be daunting. The first time I spun up a cloud server, I thought the hard part was over. It wasn't. The server was open to the world: root login enabled, port 22 broadcasting, and more vulnerabilities. I learned to automate hardening with a single script that tackles the most common security issues. This not only saves time but ensures consistency across deployments. Read more here.

QUICK HITS

Why Validate Angular Compatibility Using Published npm Package — Discover a more reliable way to test Angular library compatibility. By using the published npm package instead of the source code, you avoid discrepancies that can lead to runtime issues. Learn more.

Managing Imports with Python's __all__ — Control your module's public API effectively. The dunder all variable dictates what gets imported when using wildcard imports, ensuring cleaner and more manageable code. Check it out.

A Guide to Modern React Form Architecture — Simplify your React forms using TanStack Form, Zod, and Shadcn. This combination helps in building production-ready forms with ease, reducing boilerplate and enhancing validation. Read the guide.

Using NumPy reshape() to Change the Shape of an Array — Master array manipulation in Python with NumPy's reshape() method. This function allows you to change array dimensions and control data organization, which is essential for data preprocessing. Get the details.

ONE THING TO TRY

Try automating your server hardening process with the script shared above. It could save you hours of manual configuration!

Happy coding!

Get this in your inbox every week

Subscribe for Free →