Skip to content

Instantly share code, notes, and snippets.

View dipeshhkc's full-sized avatar
🏠
Working from home

Dipesh KC dipeshhkc

🏠
Working from home
View GitHub Profile
@dipeshhkc
dipeshhkc / Instructions.MD
Last active October 9, 2020 14:14 — forked from dipeshdulal/RepoAddInstructions.MD
Get a list of created PR's today.

Instructions

  1. Go to github profile page.
  2. Click on today's or some days contribution
  3. Open Inspector Window
  4. Pase the following code
let rollupWrapper = document.querySelectorAll('.profile-rollup-wrapper');

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@dipeshhkc
dipeshhkc / minimize.js
Created August 27, 2020 13:28 — forked from dipeshdulal/minimize.js
Minimize Number into K, M, G, T, P, E
var minimizeNumber = (num) => {
if(!Number.isFinite(num)) return "";
const minimizeMap = ["K", "M", "G", "T", "P", "E"];
if(num < 1000) return num.toString();
const exp = Math.floor(Math.log(num)/ Math.log(1000));
const minimized = Number((num / Math.pow(1000, exp)).toFixed(2));
return minimized+minimizeMap[exp-1];
}