Skip to content

Instantly share code, notes, and snippets.

View TheUntraceable's full-sized avatar
😴
Trying to complete projects but keep getting distracted.

TheUntraceable

😴
Trying to complete projects but keep getting distracted.
View GitHub Profile
@izxxr
izxxr / locks.md
Last active June 12, 2024 04:28
Python async I/O Locks

Python async I/O Locks

Locks are used to ensure exclusive access to a shared resource.

This statement might sound vague at first sight but this short gist outlines the working of asyncio.Lock and how you can apply it on your use cases.

Introduction

Locks solve the problem of having to deal with concurrent tasks accessing a resource that you don't want to be accessed concurrently.

In many cases, you might have a specific function that does something heavy in background or asynchronously. The problem here is that you don't want this function to be called concurrently or in other words, you don't want the task it is doing to happen concurrently. Instead, you want each of the task to happen once at a time.

@AbstractUmbra
AbstractUmbra / 00-deprecation.md
Last active August 17, 2024 20:01
discord.py 2.0+ slash command info and examples

This gist has now been 'deprecated' and has moved...

... to my blog style space for easier contribution by third parties and to provide what I believe to be an easier reading experience. Please field all enquiries and issues to the source repository.

@NovaFox161
NovaFox161 / december-summary.md
Created December 17, 2021 21:00
DDevs Q&A Summary 17/12/2021

DDevs Q&A December 2021 Summary - Happy Holidays!

Forward

This is a nonexhaustive summary of the DDevs Q&A stage. Most of the points below are paraphrased for brevity. Ephasis is my own unless explicitly stated, and my opinions on certain things may shine through. Please refer to a VOD of the stage for the exact wording from the Discord Developers.

Upcoming Features (and demos if available)

  • Application Commands Permissions V2
    • "Super super super close"
    • Will not release before the holidays because fixing things on christmas is just not cool
  • Closed beta testing will occur after the holidays
@Stalruth
Stalruth / stage_2021-12-18.md
Last active May 10, 2022 10:00
December 2021 Discord Developer stage
@svemat01
svemat01 / autoComplete.md
Last active January 16, 2022 00:33
Discord.JS AutoComplete Quick docs help

AutoComplete DJS v13.3.0

What is autoComplete?

"Autocomplete is basically choices but dynamic. every time the user presses a key in an autocomplete option, the bot gets an event and it can respond with what strings it wants discord to display as choices instead of having the choices be static." - Urcute#3119 on Discord

How do we use it?

For this guide, our command will be named autocomplete, this is not some built in command.

Prepare option for autocomplete

Before we can start to recieve autocomplete events on an option, we have to actually tell discord that we want it.

@amishshah
amishshah / discordjs.md
Created October 22, 2021 22:36
tl;dr i'm stepping down as owner of discord.js!

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
@LeviSnoot
LeviSnoot / discord-timestamps.md
Last active September 20, 2024 09:19
Discord Timestamp Syntax

Discord Timestamps

Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.

The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).

Formatting

Style Input Output (12-hour clock) Output (24-hour clock)
Default <t:1543392060> November 28, 2018 9:01 AM 28 November 2018 09:01
@hyrious
hyrious / nodejs-on-exit.js
Created November 22, 2020 05:04
how to do something before exit in NodeJS
// only works when there is no task running
// because we have a server always listening port, this handler will NEVER execute
process.on("beforeExit", (code) => {
console.log("Process beforeExit event with code: ", code);
});
// only works when the process normally exits
// on windows, ctrl-c will not trigger this handler (it is unnormal)
// unless you listen on 'SIGINT'
process.on("exit", (code) => {
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active September 21, 2024 11:25
Conventional Commits Cheatsheet

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@Rapptz
Rapptz / rdanny.md
Created December 20, 2015 00:29
R. Danny v3.0.0

R. Danny v3.0.0 ideas:

  • Fully asyncio rewrite.
    • Will use the async branch (or v0.10.0) when it becomes available.
  • Authority system based on permissions/roles.
    • e.g. Manage Messages -> !cleanup is valid
    • e.g. Bot Mod -> can call bot commands without having the permissions themselves
    • This will make it easier for people to administrate on servers I'm not on.
  • Remove cronjob and pass it in as a background task to the event loop
  • Lowers the need of dependencies by quite a bit.