ruby
ruby
idesign
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.
devcontainer
What is Devcontainer? Short and easy guide on how to use it
DevContainers pack your whole development environment into a container: app, database, Redis, and tooling isolated from your machine. A short guide to Rails 7.2's built-in devcontainer generator, the files it creates, and opening the project in VS Code.
Latest
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.
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.
BiomeJS - A 35x faster alternative to Prettier for formatting and linting
BiomeJS formats and lints JavaScript, TypeScript, JSX, and JSON up to 35x faster than Prettier, with almost 97% compatibility. How to install it, migrate your Prettier config to biome.json, and cut minutes off CI without changing how your code looks.
Introduction to the AbortController in JavaScript
JavaScript's AbortController lets you cancel fetch requests on demand: wiring an AbortSignal into fetch, calling abort, listening for the abort event, and handling cancelled requests without unhandled errors, with runnable examples.
How to enable signing commits in Git using GPG keys
Signed Git commits set up in minutes: the modern SSH key method for git 2.34+, from gpg.format ssh config through adding your key on GitHub, so your commits get the Verified badge. Commands included for Mac and Linux.
Simplify complicated Typescript - KISS
Simplifying complicated TypeScript with the KISS principle: refactoring examples show when explicit types improve a simple function and when clever type gymnastics make code harder to review, test, and maintain.
Docker cached and delegated to speed up IO
Docker's cached and delegated volume modes explained: how the three consistency options differ, when to relax host-container syncing for faster I/O, and a docker-compose Nginx example showing exactly where to put each flag.
Advanced Switch Case Techniques in TypeScript
TypeScript switch statements can be more than a chain of cases: wrap the switch in a function for cleaner returns, or swap it for an object map for flat, readable branching. Each technique comes with code samples, pros, and cons so you can pick the right one.
How to remove a committed file from Git history forever
Committed an .env file with secrets to Git? Three steps remove it from history forever: add it to .gitignore, rewrite every commit with git filter-branch, then git push --force the cleaned history. Exact commands included, plus what the rewrite does to your repository.
Demystifying and writing own DSL in Ruby by examples - a practical guide
Ruby DSLs demystified by building three of them: a Minitest-like test framework, a Rails-style routes definition, and an RSpec-like spec syntax. See how blocks, instance_eval, and Ruby metaprogramming turn plain classes into a friendly mini-language.
Painting 'Lady with a weasel' using genetic algorithms and Ractor parallelism in Ruby
Genetic algorithms meet Ruby Ractors: a script that repaints Lady with a Weasel generation by generation. Follow the full lifecycle (mutation, fitness scoring, crossover), see how Ractor parallelism speeds up scoring specimens, and view the final result.
Understanding Record type in Typescript
The Record utility type in TypeScript builds object types with fixed keys and value types. A worked example shows Record<Keys, Type> with union keys: restricting IDs to chosen literals and mixing User and AdminUser values, so the compiler flags missing or extra entries.
What is ETag and how to use it in Rails for caching?
ETags let browsers skip downloading content that has not changed. What entity tags are in HTTP, then the Rails caching toolkit: stale?, fresh_when, expires_in, expires_now, public requests, and http_cache_forever, each shown with a concrete controller example.
How to run a command in the background and then kill it under bash terminal?
Run any command in the background in bash by appending &, check it with jobs, and stop it with kill -9 %. A short guide using a Rails server as the example, so long-running processes stop blocking your terminal while you keep working.
Adjusting padding bottom for navigation in iOS and Android
Bottom navigation sitting too close to the screen edge on iPhone X and newer? The fix for iOS and Android PWAs is the safe area: use CSS env(safe-area-inset-bottom) to adjust the bottom padding so the bar clears rounded corners and the home indicator.
What is prototype in Javascript?
JavaScript prototypes explained through a working example: turning a standalone myCustomForEach helper into an Array.prototype method you can call directly on any array. See how prototypes share properties and methods between instances of the same object type.
Understanding the Singleton Pattern in Ruby
The Singleton pattern in Ruby, shown two ways: a hand-rolled class using private_class_method :new with a self.instance accessor, then a cleaner refactor with the built-in Singleton module. What the pattern guarantees and when one shared instance is worth it.
What is instance and class variable in Ruby?
Instance variables versus class variables in Ruby: what @ and @@ actually mean, why an @ variable set at the class level stays empty when read from an instance, and how @@ values are shared by every instance. Short code samples make each behavior easy to verify.
Extend, prepend and include in Ruby
Extend, prepend, and include in Ruby each add module code to a class differently: prepend puts the module before the class so its methods win, extend adds class methods, include adds instance methods. Short runnable examples show how each changes the method lookup chain.
Understanding anonymous functions: Blocks, Procs, and Lambdas in Ruby
Blocks, procs, and lambdas in Ruby all wrap code you can pass around, but they differ in how they check arguments and handle return. Implicit and explicit blocks with yield, building reusable procs, and when a lambda is the safer pick, all shown with runnable examples.