Pyenv
will allow you to switch to different versions of python locally (much like nvm
for node.js or jenv
for java)
brew install pyenv
brew install xz
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]
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
// 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' })
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 |
Say 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.
// 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.000Z