Skip to content

Instantly share code, notes, and snippets.

View ioistired's full-sized avatar

io ioistired

View GitHub Profile
{
"people": [
{
"names": [
"grinning"
],
"surrogates": "😀",
"unicodeVersion": 6.1
},
{
@ioistired
ioistired / repository_names.rb
Created June 1, 2020 22:56
github repository name generator
# Creates a fun suggested name for users
def suggested_name
prefix = rand < 0.25 ? "octo-" : ""
"#{adjectives.sample}-#{prefix}#{nouns.sample}"
end
ADJECTIVES = %w[
animated
automatic
bookish
@ioistired
ioistired / bot_example.py
Last active September 9, 2019 20:13 — forked from EvieePy/bot_example.py
A Cogs Example for the rewrite version of - discord.py
import discord
from discord.ext import commands
import sys, traceback
"""This is a multi file example showcasing many features of the command extension and the use of cogs.
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic
understanding and platform for creating your own bot.
These examples make use of Python 3.6+ and the 1.0.0 version on the lib.
@ioistired
ioistired / inspectable_timeit.py
Last active June 26, 2019 20:05 — forked from imayhaveborkedit/timeit.py
Like `python -m timeit` but you can probe the results
import timeit as _timeit
import math
import sys
import warnings
from dataclasses import dataclass, field
from typing import List
def timeit(stmt, *, setup='pass', repeat=5, number=0, precision=3, globals=None):
timer = _timeit.Timer(stmt, setup, globals=globals)
@ioistired
ioistired / emote_collector.utils.image.py
Created December 2, 2018 01:29
emote collector memory leak debugging
import contextlib
import imghdr
import io
import logging
logger = logging.getLogger(__name__)
try:
import wand.image
except ImportError:
@ioistired
ioistired / .gitignore
Last active August 17, 2018 08:39
discord.py@rewrite tool to monkey patch functions that run before every invocation of Messageble.send
*.swp
*.py[cod]
venv/
.venv/
@ioistired
ioistired / privatebin.py
Last active June 15, 2018 04:07
Simple aiohttp PrivateBin client
#!/usr/bin/env python3
# encoding: utf-8
"""
privatebin.py: uploads text to privatebin
using code from <https://github.com/r4sas/PBinCLI/blob/master/pbincli/actions.py>,
© 2017–2018 R4SAS <[email protected]>
using code from <https://github.com/khazhyk/dango.py/blob/master/dango/zerobin.py>,
© 2017 khazhyk
"""
@ioistired
ioistired / make-certs.sh
Last active February 28, 2024 10:58
make caddy certs (make sure ports 80 and 443 are open first)
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit
fi
tmp=$(mktemp --directory)
cd $tmp
wget --content-disposition 'https://caddyserver.com/download/linux/amd64?license=personal'
@ioistired
ioistired / fix_sums.py
Created December 10, 2017 08:43
SHA256SUMS fixer
#!/usr/bin/env python3
# encoding: utf-8
import fileinput
def fix_sums():
"""fixes a checksums file in this format:
\d4e9b804eb556f8140b17921 *C:\\TV\\My Show.mkv
\885083f72a4211a6f95eb380 *C:\\Movies\\My Adventure.mkv
@ioistired
ioistired / revisionist.py
Last active April 29, 2023 08:10
Discord selfbot that lets you see when people edit or delete their messages
#!/usr/bin/env python3
# encoding: utf-8
"""
Revisionist: logs Discord message edits and revisions
Copyright © 2017 Benjamin Mintz
https://bmintz.mit-license.org/@2017
"""
import discord