Skip to content

Instantly share code, notes, and snippets.

Avatar

Edaz edazpotato

View GitHub Profile
@amishshah
amishshah / discordjs.md
Created Oct 22, 2021
tl;dr i'm stepping down as owner of discord.js!
View discordjs.md

Hello! I'm Amish (also known as hydrabolt), and I am the creator of discord.js.

I created discord.js as a hobby/learning project for myself in August 2015 while I was still a teenager in school.

More than 6 years later, discord.js has become more popular than I could ever imagine, and I cannot express how grateful I am to the other contributors and the community for this amazing experience.

A few of my favourite highlights include:

  • The countless voice rewrites (I think we're done with that now 😉)
  • The April Fools' traditions
@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));
}
@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"
View performancemods.md

I do not maintain this list anymore:

Go to https://github.com/NordicGamerFE/usefulmods an updated version

Performance Mods

A list of performance-enhancing mods for most major-played versions.

Any suggestion/complaint?
~ Ping alkya#1273 in Modded Minecraft or use the gist comments.

Mods marked as "Dangerous" might be unstable, and cause some unexpected behaviour.

@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 / 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
@Reine0017
Reine0017 / sketch.js
Last active Dec 15, 2020
Simple Drawing app - sketch.js (1)
View sketch.js
window.addEventListener("load", () => {
const canvas = document.querySelector("#canvas");
const ctx = canvas.getContext('2d');
const img = new Image();
img.src = "assets/images/reinePic.jpg";
img.onload = () => {
const [img_scaled_width, img_scaled_height] = drawImageToScale(img, ctx);
canvas.width = img_scaled_width;
@RoccoDev
RoccoDev / hash.rs
Last active Feb 19, 2022
Minecraft SHA-1 complement hash calculation in Rust
View hash.rs
// Copyright (C) 2019 RoccoDev
// Licensed under the MIT license.
// <https://opensource.org/licenses/MIT>
// Bench results:
// First hash: 152ms
// Second hash: 1ms
// Third hash: 0ms
extern crate crypto; // Tested with 0.2.36
@oze4
oze4 / v-cloak.css
Created Feb 9, 2019
v-cloak for vue.js loading
View v-cloak.css
[v-cloak] {
display: block;
padding: 50px 0;
}
@keyframes spinner {
to {
transform: rotate(360deg);
}
}