Adjusting padding bottom for navigation in iOS and Android ios

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.

Nov 6, 2023

What is prototype in Javascript?

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.

Who is the product owner?

Who is the product owner?

A product owner is defined by real decision-making power: controlling the budget, setting the vision and strategy, and owning the backlog. What each responsibility means in practice, plus a blunt list of cases where, despite the title, you are not the product owner.

Understanding the Singleton Pattern in Javascript

Understanding the Singleton Pattern in Javascript

The Singleton pattern in JavaScript ensures one shared instance with a global access point. A practical implementation using an object literal and Object.freeze, a shared bucket example, and where a singleton fits: configuration, logging, or a central data store.

Understanding the Singleton Pattern in Ruby

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 ACID?

What is ACID?

ACID stands for Atomicity, Consistency, Isolation, and Durability: the four guarantees behind reliable database transactions. Each property explained with a concrete Rails example, like wrapping a money transfer in a transaction so it fully succeeds or rolls back.

What is instance and class variable in Ruby?

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

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.

class_eval, instance_eval and instance_exec in Ruby

class_eval, instance_eval and instance_exec in Ruby

class_eval, instance_eval, and instance_exec power Ruby metaprogramming: reopening classes, running blocks inside an object, and passing arguments in. All explained through one MyWebServer class with a configure DSL, ending in a reusable AppConfig settings pattern.

Attribute selector power in CSS

Attribute selector power in CSS

CSS attribute selectors give you styling control beyond classes and IDs: target inputs by type, style elements with custom attributes, match specific class values, and automatically mark external links. Copy-ready snippets for each case, no extra classes needed.

Understanding TypeScript Function Generators

Understanding TypeScript Function Generators

TypeScript function generators can pause and resume execution, returning values one at a time instead of all at once. What generators are, how yield works in a simple example, and a practical number sum generator that shows where they beat regular functions.

Powerful switch statement with pattern matching in Ruby

Powerful switch statement with pattern matching in Ruby

Pattern matching in Ruby turns case statements into a precise switch over data shapes: match and destructure hashes from an API response, combine several patterns in one branch, capture values across patterns, and validate configuration. Ruby 2.7+ syntax examples.

How to deal with infinite scroll in React

How to deal with infinite scroll in React

Infinite scroll in React gets much easier with react-query: the useInfiniteQuery hook fetches posts page by page, cancels stale requests with AbortSignal, and exposes fetchNextPage for loading more. A complete typed example wrapped in a reusable usePosts hook.