Decorators in Python offer a flexible way to modify function or class behavior, enabling code extension without permanent changes. This blog post delves into first-class functions, simple and advanced decorators, and their usage with arguments and return values. Examples illustrate how decorators enhance code modularity and maintainability. Learn how to apply decorators to functions and classes effectively.
In this post, explore the crucial concepts of mutable and immutable types in Python. Understand how immutable types like strings and integers ensure data integrity by preventing changes once created, while mutable types like lists and dictionaries allow in-place modifications. Learn with practical examples and see why grasping these concepts is essential for writing robust and efficient Python code.
Managing multiple Java versions on MacOS can be challenging, but with the right tools, it becomes effortless. This guide walks you through installing Homebrew, setting up several Java versions (8, 11, 17, 21), and configuring your shell for easy switching. By following these steps, you can seamlessly manage different Java versions for various projects, ensuring smooth development workflows. Happy coding!
I couldn't find a cheap private PyPi server option, so I started my own. It runs on a t2.micro EC2 instance for around $10/month — or free for the first year on AWS Free Tier. In this tutorial, I walk through the full setup: EC2, Docker, Terraform, and password-protected access with pypiserver. Read on if you want the cheapest private PyPi server that exists right now.
AWS Lambda concurrency is one of those things you don't think about until you're in the middle of a production incident. Throttles start happening, requests pile up in the queue, and you're left wondering what went wrong. In this post, let's go through all the concurrency configurations Lambda has to offer — unreserved, reserved, provisioned, SQS max concurrency, and the Kinesis parallelization factor — so you can make informed decisions before things break.
In this post, we continue the AWS Lambda series and take a closer look at lambda instances and start types. To make things concrete, I'll use a simple Hello World function with a counter so you can see exactly what happens at each stage.
We'll walk through what a cold start is, what code runs during it, and how AWS reuses lambda instances for subsequent invocations. If you've ever seen "Init Duration" in your lambda logs and wondered what it means — this one's for you.
AWS Lambda has three invocation types — synchronous, asynchronous, and poll-based — and understanding the difference can save you from some tricky production surprises. With synchronous, your caller waits. With asynchronous, it fires and forgets. With poll-based, AWS does the polling for you.
This is the first post in my series on not-so-obvious AWS Lambda things. Read on for concrete examples of each invocation type, including boto3 code snippets and a poll-based gotcha worth knowing before you hit it in prod.