Skip to content

Instantly share code, notes, and snippets.

View Xevion's full-sized avatar
⚜️
Noblesse Oblige

Xevion Xevion

⚜️
Noblesse Oblige
View GitHub Profile
@EvieePy
EvieePy / error_handler.py
Last active January 16, 2024 15:12
Simple Error Handling for ext.commands - discord.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
@JonnyWong16
JonnyWong16 / update_all_metadata.py
Last active March 19, 2024 17:31
Updates all metadata in the Tautulli database after moving Plex libraries.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Updates all metadata in the Tautulli database after moving Plex libraries.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests
from plexapi.server import PlexServer
import requests
@wolever
wolever / watchdog.py
Created December 2, 2016 23:57
A simple watchdog for long-running Python processes
"""
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 March 29, 2024 01:12
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {
@luhn
luhn / getter_and_setter.py
Created November 29, 2012 18:35
Using getters and setters with SQLAlchemy
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):