On JSON.stringify()Background When working with a Node.js service, I intended to send a request to another service with JSON: { "name": "Instant noddle", "category": null } However, I didn't manage to send the category field and this is what I sent instead: { ...1 min read·redhoyasa.hashnode.devSep 18, 2023
Triggering form submission outside the <form>Context Suppose I want to build a checkout page like below: The first box (above) contains the guest form The second box (below) is a bottom sheet containing the hotel rate and the form submission button To make the bottom sheet sticky at the bo...1 min read·redhoyasa.hashnode.devSep 18, 2023
Logging inside Java StreamBackground Once upon a time, I wanted to log something that was executed inside the Java stream for debugging purposes. But, I didn't see anything logged there. Solution Put the log inside the peek() method instead of map(). Example Previously, I was...1 min read·redhoyasa.hashnode.devJul 11, 2023
Updating database field to NULL in GORM using structBackground When I was using GORM as the ORM in Go, I discovered that we cannot update a field into NULL with struct, even though we use a pointer as the type. For example, if we set nil to the Name and execute the Updates method in GORM, the name fie...1 min read·redhoyasa.hashnode.devJan 10, 2023
Working with Postgres JSONB in GoBackground Suppose I want to store and read a JSONB/JSON column from Postgres, how do I do it? Solution Make the data type implements these functions: Scan(src any) error -> Move data from DB to Go struct Value() -> Return the JSON encoding that sto...1 min read·redhoyasa.hashnode.devDec 14, 2022