// npm install date-fns date-fns-tz
import { fromUnixTime, } from 'date-fns';
import { utcToZonedTime, format as utcFormat } from 'date-fns-tz';
// Unix epoch timestamp is a string in milliseconds in UTC
const unixTimestampString = '1692761130000'; // 2023-08-23 03:25:30.000ZSay you have a class named AbcClass.
If AbcClass depends on AnotherClass, and AnotherClass eventually needs to make a network call (e.g. to S3, Databse, GIS, some other party), then don't instantiate AnotherClass inside AbcClass.
AnotherClass should be injected into the constructor of AbcClass.
Say AnotherClass is instantiated inside AbcClass.
When you write a test for AbcClass, AnotherClass will inevitably make a network call.
| branch prefix | desc | touches prod code |
|---|---|---|
| +:refs/heads/(feature/*) | add new feature | Y |
| +:refs/heads/(fix/), +:refs/heads/(hotfix/) | bug fix | Y |
| +:refs/heads/(refactor/*) | change code.e.g. renaming a variable | Y |
| +:refs/heads/(docs/*) | changes to docs | N |
| +:refs/heads/(style/*) | formatting, missing semi colons | N |
| +:refs/heads/(test/*) | adding missing tests, refactoring tests | N |
| +:refs/heads/(chore/*) | updating build scripts | N |
// npm i date-fns-tz
import { utcToZonedTime, format as utcFormat } from 'date-fns-tz'
const main = async (): Promise<void> => {
const dateInUtc: Date = utcToZonedTime(new Date(), 'UTC')
const formattedDateInUTC = utcFormat(dateInUtc, 'yyyy-MM-dd\'T\'HH:mm:ss\'Z\'', { timeZone: 'UTC' })import * as polyline from '@mapbox/polyline';
/**
* coords is encoded using the Google Maps algorithm for polyline encoding. See
* https://developers.google.com/maps/documentation/utilities/polylinealgorithm
* Use this for decoding https://www.npmjs.com/package/@mapbox/polyline-
For macOS,
brew install gnupg -
Follow instructions here https://docs.gitlab.com/ee/user/project/repository/signed_commits/gpg.html
-
Your .gitconfig should look like this:
[user]