Skip to content

Instantly share code, notes, and snippets.

View gogones's full-sized avatar
👋
Goo

Annas Alghoffar gogones

👋
Goo
View GitHub Profile
This a comparison to help myself decide my IDE, listed in order of importance.
## Context
1. Coding in Typescript for 2 year, 3 years on NodeJS before that, 15+ years in general (mostly Java)
2. Spent about 6 months on VS Code and 6 month with WebStorm
3. Cost is not a factor (company provides JetBrain licenses)
4. What my projects look like: back-end, OOP, Typescript, Mocha, ESLint, pnpm and monorepos (~15 packages, ~300 files)
## WebStorm does better
@gogones
gogones / pxToViewport.ts
Created July 2, 2024 06:57
Get value vw/vh from px given relative to screen define
export const pxToVw = (px: number, windowWidth?: number) =>
`${(px / (windowWidth ?? window.innerWidth)) * 100}vw`;
export const pxToVh = (px: number, windowHeight?: number) =>
`${(px / (windowHeight ?? window.innerHeight)) * 100}vh`;