Front-End

SVG Attributes for Sizing Doesn’t Work on iPhone

I created a website that uses SVG files imported in img tags. It looked fine. When I tested the mobile version with iPhone, the SVG was bloated. It worked fine with Android with Chrome, Windows with Chrome and Mac with both Safari and Chrome. For some reason, the sizing attributes, …

DBA

Deleting Records in Nested BSON Array from MongoDB

When you are trying to manipulate data within nested BSON array in MongoDB, things get complex. Luckily, MongoDB has the ability to pass a JavaScript-like function to forEach to manipulate or query data. Let’s take a look at the data below. Sample Data { “_id”: ObjectId(“5a2f38458bcodgerce87vds”), “customerId”: “45632”, “cart”: { …

Front-End

Why Istanbul Is Not Working After Cloning A Repo

I got a new laptop. I installed the latest Node.js and cloned a repo to keep continuing with my React project. I ran npm i to install all dependencies. The app started fine and built fine. However, when I ran npm test, the test was not running. My test script …

.NET

Hosting ASP.NET Core Website with InterServer

Ok, you developed a cool APS.NET Core website. Now, it’s time to get it out to the world. There are many hosting options out there. You can take a more hands-on approach like deploying to AWS or Azure. Or, you can use the hosting service provider without any hustle of …

.NET

Implementing Dependency Injection in ASP.NET Core

Dependency Injection is the heart of clean architecture for an ASP.NET Core application. It is supported out of the box when you create an ASP.NET Core application with the Microsoft.Extensions.DependencyInjection module. In the start up file, you can add the mapping between interface and actual implementation. IServiceCollection has methods to …

.NET

How to Deploy ASP.NET Core Application to Windows with IIS

An ASP.NET Core application is hosted on Kestrel on both Windows and Linux. Kestrel is a web application server (just like Tomcat or NodeJS). It is included by default in ASP.NET Core project templates. Although ASP.NET Core application can run solely run on Kestrel, it is recommended to use it …

Front-End

Releasing Multiple PWAs to GooglePlay By Using a Single GitHub Page Root

PWA is pretty exciting. As long as you have a static web hosting service, you can create a mobile app with a web site. I’ve written a few posts about packaging and releasing an Android app to GooglePlay in the past. – Tips on Creating Android App from PWA – …

Front-End

Better Way to Attach Event Listener with Vanilla JS

Let’s discuss a better way to attach event listeners to a bunch of HTML elements selected by a class name with vanilla JavaScript. With jQuery, this is super easy. You just select the elements by a class name and use .on(). jQuery will handle event listener attachments to multiple elements. …

Front-End

Replacing Local Storage with IndexedDB

When you build a PWA, you often have to store data locally. The easiest way is to use LocalStorage. Data persists even after ending sessions and it does easy synchronous read-write operation. Although you need to convert a JSON object to string because LocalStorage only supports string, the programming overhead …

Front-End

Unit Testing Event Listeners on Form Input Fields with Karma

Karma is a JavaScript test runner where you can run your unit tests on headless chrome or real browsers. Because it runs on the real browser, it supports the browser web APIs and makes it easy to test front-end JavaScript. With Karma, the environment where unit tests run is truer …