Tran Sang Dev Blog
  • HOME
  • Meta Programming
  • Javascript
  • bash
Subscribe

programming

A collection of 3 posts
Get understand the user-agent string of the browser
web

Get understand the user-agent string of the browser

Let see an example of a user-agent string Mozilla/5.0 (Linux; Android 7.1.1; TONE-m17) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.89 Mobile Safari/537.36 This is a typical user-agent string whose content is combined of 4 parts * Mozilla/5.0 (Linux; Android
Aug 7, 2019 — 1 min read
Promise based semaphore pattern in Javascript
programming

Promise based semaphore pattern in Javascript

Let's start with a singleton pattern when you want to instantiate at most one instance of a class, or lazily initiate a value. let instance const getInstance = () => instance === undefined ? instance = initiateInstance()//this is a heavy task and should be done at most once in the whole life of the application
Jul 5, 2019 — 1 min read
Best practices when working with universal time
programming

Best practices when working with universal time

It is a normal situation that the server, client, and database have different timezones. In this blog, I will introduce my coding practice to handle multiply timezones in software development. Check the timezone setting of the current machine Method 1: use the date command and check the timezone part (JST
Dec 29, 2018 — 11 min read
Tran Sang Dev Blog © 2023