Skip to content
tezvyn:

Search

Find a bite, explore a topic or look for a role.

Results for Python

Bites 291

LLMs & Generative AI2 min read

Task Decomposition: Teaching LLMs to Plan

Task decomposition for an LLM agent is like writing a recipe: break a big goal into a checklist of small, executable steps. It's vital for complex requests like planning a trip, but a bad initial plan can cause cascading failures that doom the entire process.

Core ML: On-Device Machine Learning for Apple Apps
iOS & Swift2 min read

Core ML: On-Device Machine Learning for Apple Apps

Core ML runs pre-trained machine learning models directly on Apple devices, enabling fast, private, and offline AI. It's used for features like real-time image recognition or text analysis. The footgun: Core ML only runs models; it doesn't train them.

Push Notifications: Strategy Over Noise
Growth & Experimentation2 min read

Push Notifications: Strategy Over Noise

A push notification strategy treats a user's lock screen like rented real estate, not a free megaphone. It's used by mobile apps to re-engage users with timely value, like sales or reminders.

Go & Rust2 min read

cbindgen: Auto-generate C/C++ Headers for Rust

cbindgen automatically generates C/C++ headers for your Rust code, saving you from writing tedious FFI boilerplate. Use it when exposing a Rust library to other languages. Its feature set is ad-hoc, so it may not support your specific edge case out of the box.

Go & Rust2 min read

Rust: Expose Functions to C with `#[no_mangle]`

The #[no_mangle] attribute tells the Rust compiler not to alter a function's name, exposing a stable symbol for C code to call. Use it with extern "C" to create Rust libraries for other languages. The footgun is forgetting extern "C", causing crashes.

Go & Rust2 min read

Rust: Bridging C Strings with CStr and CString

CString and CStr are Rust's safe wrappers for C's nul-terminated strings. CString builds a C-compatible string to pass *out* of Rust; CStr interprets one coming *in*. Use them for any FFI calls.

Go & Rust2 min read

Regex Engines: Backtracking vs. Finite Automata

A backtracking regex engine tries one path at a time, which can be fast but also exponentially slow. A finite-automata engine (like Go's) checks all paths at once, guaranteeing linear time. The footgun is using a backtracking engine on untrusted user input.

Go & Rust2 min read

Rust's Turbofish (`::<>`): When the Compiler Needs Help

The turbofish (::<>) is your tool to resolve ambiguity when Rust's compiler can't infer a type or trait. Use it when a type implements multiple traits with same-named methods, forcing the compiler to pick the one you specify.

Go & Rust2 min read

Go's Design Philosophy: Engineering Over Novelty

Go's design philosophy is engineering over novelty, built to solve Google's problems with slow builds and complexity in massive codebases. It excels at large, networked systems where maintainability and fast compilation are critical.

Prometheus Exporters: Translating Metrics for Monitoring
Docker & Kubernetes2 min read

Prometheus Exporters: Translating Metrics for Monitoring

A Prometheus Exporter is a translator, converting metrics from third-party systems like databases or hardware into the format Prometheus can scrape. Use one when you can't modify an app's code directly.

Kubernetes Jobs: For Tasks That Need to Finish
Docker & Kubernetes2 min read

Kubernetes Jobs: For Tasks That Need to Finish

A Kubernetes Job runs a task to completion, unlike a Deployment which runs forever. Use it for one-off operations like database migrations or batch processing. The footgun is forgetting to set a retry limit, causing failed jobs to loop indefinitely.

Docker & Kubernetes2 min read

Artifact Registry: Google's Universal Package Manager

Artifact Registry is a private, universal package manager for all your software components, not just Docker images. Use it to store your company's Docker images, Java JARs, and Helm charts in one place, integrated with GCP CI/CD.

Docker & Kubernetes2 min read

Docker Push and Pull: Moving Container Images

Think of docker push and pull like git push and pull, but for container images. They move images between your machine and a remote registry. A common mistake is forgetting to tag an image with the registry's full address before pushing.

Docker & Kubernetes2 min read

Docker Compose: Orchestrate Multi-Container Apps Locally

docker compose is a conductor for multi-container apps, using a single YAML file to define and run all the parts of your stack together. It's ideal for local development to spin up a database and API with one command.

Docker & Kubernetes2 min read

Docker Image Scanning: A Background Check for Your Code

Docker image scanning is a background check for your software dependencies, checking packages against known vulnerability lists (CVEs). It's used in CI/CD to block vulnerable builds and in registries for continuous monitoring.

Docker & Kubernetes2 min read

Docker Multi-stage Builds: Slimmer, Faster Images

Treat your Dockerfile like a pipeline: build your app in one stage with all its tools, then copy only the final artifact to a clean production stage. This keeps images small by excluding build-time dependencies.

Docker & Kubernetes2 min read

Docker Networking: How Containers Talk to Each Other

Docker gives each container its own isolated network, preventing port conflicts. Containers connect via networks, like bridge for local communication. For containers to find each other by name, you must use a user-defined bridge network; the default one…

Docker & Kubernetes2 min read

Docker Image Tagging: Versioning for Containers

A Docker tag is a human-readable label for a specific image version, like ubuntu:22.04. You use tags to pull specific base images or version your own builds. The biggest footgun is relying on the latest tag, which is just a convention.

Docker & Kubernetes2 min read

The 'Works on My Machine' Problem

Code runs on your laptop but fails in production because of hidden differences in environments. Docker solves this by packaging an app and its dependencies into a portable container, ensuring it runs the same everywhere.

Design Systems2 min read

Semantic Versioning: The MAJOR.MINOR.PATCH Contract

Semantic Versioning (MAJOR.MINOR.PATCH) is a contract that tells users if an update will break their code. It's used by package managers to safely resolve dependencies.