Skip to content

Instantly share code, notes, and snippets.

Avatar

Edaz edazpotato

View GitHub Profile
@edazpotato
edazpotato / v-cloak.css
Last active Sep 22, 2020 — forked from oze4/v-cloak.css
v-cloak for vue.js loading
View v-cloak.css
[v-cloak] {
visibility: hidden;
display: block;
padding: 50px 0;
}
@keyframes spinner {
to {
transform: rotate(360deg);
}
@edazpotato
edazpotato / abbreviate-number.js
Created Dec 30, 2020 — forked from tobyjsullivan/abbreviateNum.js
Abbreviate large numbers in Javascript (as a es6 module)
View abbreviate-number.js
export default function abbreviateNumber(value) {
let newValue = value;
const suffixes = ["", "K", "M", "B","T"];
let suffixNum = 0;
while (newValue >= 1000) {
newValue /= 1000;
suffixNum++;
}
newValue = newValue.toPrecision(3);