Skip to content

Instantly share code, notes, and snippets.

Avatar
🏳️‍🌈
School burns out my passion for programming

Xevion Xevion

🏳️‍🌈
School burns out my passion for programming
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am xevion on github.
  • I am xevion (https://keybase.io/xevion) on keybase.
  • I have a public key ASAm89LfSNcdbKWjNBgQHChPenOqyJRNxS7b_vF7uSNpYAo

To claim this, I am signing this object:

@Painezor
Painezor / Checks.py
Last active Mar 5, 2021
Built-in Checks for the commands extension of discord py
View Checks.py
@commands.guild_only()
# Command cannot be used in private messages.
@commands.dm_only()
# Command can only be used in private messages.
@commands.is_owner()
# Command can only be used by the bot owner.
@commands.is_nsfw()
@EvieePy
EvieePy / error_handler.py
Last active Feb 26, 2021
Simple Error Handling for ext.commands - discord.py
View error_handler.py
"""
If you are not using this inside a cog, add the event decorator e.g:
@bot.event
async def on_command_error(ctx, error)
For examples of cogs see:
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
For a list of exceptions:
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#exceptions
@wolever
wolever / watchdog.py
Created Dec 2, 2016
A simple watchdog for long-running Python processes
View watchdog.py
"""
A simple watchdog for long running processes which may stall for some reason or
another.
If the main thread hasn't logged progress (by updating
``self.last_progress_time``) in WATCHDOG_HARD_KILL_TIMEOUT, the watchdog
thread will log an error containing the stack trace of all currently running
threads then use ``kill -9`` to kill the main process.
Assumes that a process monitor like supervisor or systemd will then restart
@magicznyleszek
magicznyleszek / css-selectors.md
Last active Mar 5, 2021
CSS Selectors Cheatsheet
View css-selectors.md

CSS Selectors Cheatsheet

Element selectors

Element -- selects all h2 elements on the page

h2 {
    foo: bar;
@luhn
luhn / getter_and_setter.py
Created Nov 29, 2012
Using getters and setters with SQLAlchemy
View getter_and_setter.py
class Table(Base):
id = Column(Integer, primary_key=True)
_name = Column('name', String(24))
@property
def name(self):
return self._name;
@name.setter
def name(self, value):