How to listen to Rails events ruby

How to listen to Rails events

ActiveSupport::Notifications lets you listen to Rails events like transaction.active_record without extra gems. How the instrumentation API works, subscribing to built-in Rails events, and publishing your own custom events for better observability.

Nov 18, 2024

How to communicate effectively: beyond words development

How to communicate effectively: beyond words

Effective communication in tech teams starts with context: "the payment module shows timeout errors" beats "it's broken". Communication styles, framing, active listening techniques, common pitfalls, and how clear messages build trust with your team.

Nov 4, 2024

How to upgrade PostgreSQL from 16 to 17 in Docker

How to upgrade PostgreSQL from 16 to 17 in Docker

Upgrading PostgreSQL from 16 to 17 in Docker without losing data: run both versions side by side in docker-compose, back up with pg_dump, restore into the new container, then switch the app over. Five concrete steps plus the gotchas to watch out for.

How to deploy NextJS app using Docker with Bun

How to deploy NextJS app using Docker with Bun

Deploy a NextJS app with Docker and Bun using a three-stage Dockerfile: install dependencies with a frozen lockfile, build the app, then run the standalone output on oven/bun:alpine. Faster installs than npm and a small production image, step by step.

Coupling issues in distributed systems

Coupling issues in distributed systems

Coupling in distributed systems goes far beyond shared code: technology, location, semantic, data format, conversation, topology, order, and temporal coupling each hurt resilience differently. What every type looks like and how to keep services independent.

Dockerizing NextJS for development - Quickstart guide

Dockerizing NextJS for development - Quickstart guide

Dockerize NextJS development with docker-compose watch: sync ./src into the container, rebuild on dependency changes, and keep hot reload working. A complete docker-compose.yml and Dockerfile you can copy for a reproducible dev environment in minutes.

What is IDesign way in architecture?

What is IDesign way in architecture?

The IDesign method by Juval Lowy structures software architecture for change instead of functional decomposition. Why decomposing by requirements breaks systems over time, the core IDesign principles, a three-step design process, and implementation tips.

Emergency root access: Leveraging Portainer when SSH fails

Emergency root access: Leveraging Portainer when SSH fails

Locked out of SSH? Portainer can get you root back: deploy a privileged busybox container that mounts the host filesystem at /host and gives you an interactive shell. The exact Docker Compose script, the security implications, and when this trick is justified.

Understanding the C4 model for software architecture

Understanding the C4 model for software architecture

The C4 model documents software architecture as four zoom levels: Context, Containers, Components, and Code. See how the diagrams work on a concrete example (a paid blog application) and why this hierarchy keeps developers and stakeholders oriented.

Streamlining Rails controllers with custom filters

Streamlining Rails controllers with custom filters

Rails controllers bloated with subscription checks? Extract that logic into custom filter classes: a before_action that delegates to a dedicated object, giving cleaner controllers, clearer error messages, easier testing, and a pattern you can expand.

CSS units - which one should be used and when

CSS units - which one should be used and when

CSS units decide how responsive and accessible your site is. A practical tour of px, em, rem, vh, vw and friends: what absolute, relative, and viewport based units really do, plus a short opinionated guide on which unit to pick for fonts, spacing, and layout.

Integrating .ruby-version into your Rails Gemfile

Integrating .ruby-version into your Rails Gemfile

Stop declaring your Ruby version twice: with a recent Bundler your Gemfile can read .ruby-version directly using ruby file: ".ruby-version". The one-line setup, the required Bundler upgrade, and how it keeps rbenv, RVM, or asdf and Rails in sync.

How to work with metadata in NextJS?

How to work with metadata in NextJS?

Metadata in NextJS drives SEO and social sharing. How to define static metadata with the metadata export, build consistent titles with templates, inherit and override values across routes, and generate dynamic metadata from fetched data.

How to deep equal in Javascript?

How to deep equal in Javascript?

Deep equality in JavaScript is trickier than it looks: JSON.stringify fails when key order differs. Compare the real options: the deep-equal package, writing your own recursive check, lodash isEqual, and Node's built-in assert.deepStrictEqual.

CSS in this year - Is that the end of SASS?

CSS in this year - Is that the end of SASS?

Modern CSS now covers most of what made SASS essential: native variables, nesting, the :is, :has and :where pseudo-classes, container queries as a mixin replacement, and cascade layers. A side by side comparison of both syntaxes to help you decide if you still need a preprocessor.

What is Turbo Frames in Rails?

What is Turbo Frames in Rails?

Turbo Frames let Rails reload just a fragment of the page instead of the whole thing, with no custom JavaScript. What Turbo Frames are within Hotwire, a practical example of wrapping views in frames, and the responsiveness gains you get almost for free.