- alefragnani.Bookmarks
- bradlc.vscode-tailwindcss
- ChakrounAnas.turbo-console-log
- CoenraadS.bracket-pair-colorizer
- dbaeumer.vscode-eslint
- donjayamanne.githistory
- dsznajder.es7-react-js-snippets
- eamodio.gitlens
- Equinusocio.vsc-community-material-theme
- Equinusocio.vsc-material-theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import cx from "classnames"; | |
| const Label = ({ children }) => { | |
| return ( | |
| <label className="mb-3 w-full font-semibold text-gray-600"> | |
| {children || "Label"} | |
| </label> | |
| ); | |
| }; | |
| const ErrorLabel = ({ children }) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1hr ago, 2 days ago etc | |
| const getFuzzyTime = (millisec) => { | |
| let res = ""; | |
| const t_second = 1000; | |
| const t_minute = t_second * 60; | |
| const t_hour = t_minute * 60; | |
| const t_day = t_hour * 24; | |
| const t_week = t_day * 7; | |
| const t_month = Math.floor(t_day * 30.4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const currencies = { | |
| ADP: { | |
| code: 'ADP', | |
| name: 'Andorran peseta', | |
| currencySymbol: 'ADP', | |
| symbol: 'ADP', | |
| }, | |
| AED: { | |
| code: 'AED', | |
| name: 'UAE dirham', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ``` | |
| # Run this in CMD only and not in bash | |
| netstat -ano | findstr :3001 | |
| # This will give | |
| TCP 0.0.0.0:3001 0.0.0.0:0 LISTENING 24928 👈 | |
| TCP [::]:3001 [::]:0 LISTENING 24928 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getStringDotRefFromObject(obj, arr = [], objPath = '') { | |
| const isObject = typeof obj === 'object' && !Array.isArray(obj) && obj !== null; | |
| if (!isObject) return objPath; | |
| return Object.keys(obj).reduce((acc, curr) => { | |
| const path = obj[curr]; | |
| return acc.concat( | |
| // eslint-disable-next-line prefer-template | |
| getStringDotRefFromObject(path, arr, `${objPath ? objPath + '.' : ''}${curr}`) | |
| ); | |
| }, []); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update -y | |
| sudo apt-get upgrade -y | |
| sudo apt install docker.io -y | |
| systemctl start docker | |
| systemctl enable docker | |
| docker --version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| org: abhagsain | |
| app: abhagsain-app | |
| service: abhagsain-app | |
| frameworkVersion: "3" | |
| provider: | |
| name: aws | |
| runtime: python3.8 | |
| httpApi: | |
| cors: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # set relative line number in vim | |
| set number | |
| set rnu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Get a Google auth token given service user credentials. This function | |
| * is a very slightly modified version of the one found at | |
| * https://community.cloudflare.com/t/example-google-oauth-2-0-for-service-accounts-using-cf-worker/258220 | |
| * | |
| * @param {string} user the service user identity, typically of the | |
| * form [user]@[project].iam.gserviceaccount.com | |
| * @param {string} key the private key corresponding to user | |
| * @param {string} scope the scopes to request for this token, a | |
| * listing of available scopes is provided at |