Skip to content

Instantly share code, notes, and snippets.

Avatar
♥️
Flexbox

Edaz edazpotato

♥️
Flexbox
View GitHub Profile
@edazpotato
edazpotato / getNumbersPercentageOfSum.js
Last active Oct 2, 2021
Takes an array of numbers and returns an array of numbers in the original order which represent the percentage each number is of the sum of all of the numbers.
View getNumbersPercentageOfSum.js
function getNumbersPercentageOfSum(numbers, decimalPlaces = 2) {
let total = 0;
for (const number of numbers) {
total += number;
}
return numbers.map(number => ((number / total) * 100).toFixed(decimalPlaces));
}
View discord-expermients.js
// Code that enables discord experminets if you run it in the console
webpackJsonp.push([[999],{"l":(m,e,r)=>{for(k in r.c)(m=r.c[k].exports)&&m.default&&m.default.isDeveloper==0&&Object.defineProperty(m.default,"isDeveloper",{get:()=>1})}},[["l"]]])
@edazpotato
edazpotato / reload.js
Last active Apr 24, 2021
discord.js discord-akairo reload command that works on catergories as well as modules (commands) and has error handling!
View reload.js
const { Command } = require("discord-akairo");
class ReloadCommand extends Command {
constructor() {
super("reload", {
aliases: ["reload"],
args: [
{
id: "commandID",
default: "all"
@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);
View Unsolicited DMs.md

DM Server ads

Sorry, I don't accept unsolicited invites, and for your information they're a violation of the Discord Terms of Service. You can read more about the Terms of Service for Discord at https://discord.com/terms and contact me regarding any clarification you may require. Thank you!

Requests to buy your account

Sorry, I'm not willing to sell my account, and for your information doing so or asking someone to do so is a violation of the Discord Terms of Service. You can read more about the Terms of Service for Discord at https://discord.com/terms and contact me regarding any clarification you may require. Thank you!
@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 / bot-features.md
Last active Sep 22, 2020
Features that every discord bot should have
View bot-features.md
  • An Urban dictionary command
  • Reaction roles
  • A Purge command that defaults to 1
  • A Ban command
  • A Kick command
  • A Mute command
  • A Discord user info command
  • A Discord server info command
  • A Global ban report command
  • A Help command that's actually useful and dosen't DM you or have pages that you need to use reactions to scroll through
View keybase.md

Keybase proof

I hereby claim:

  • I am edazpotato on github.
  • I am edaz (https://keybase.io/edaz) on keybase.
  • I have a public key whose fingerprint is 9EB6 941C 5AF5 ED66 5883 DF14 84D8 7E4D DD02 D50C

To claim this, I am signing this object: