Skip to content

Instantly share code, notes, and snippets.

View NotSoSuper's full-sized avatar
🥓
test

NotSoSuper

🥓
test
View GitHub Profile
@NotSoSuper
NotSoSuper / docker-compose.yml
Created November 29, 2018 02:46
custom dockprom
version: '2.1'
services:
prometheus:
image: prom/prometheus:v2.5.0
container_name: prometheus
volumes:
- ./prometheus/:/etc/prometheus/
- ./data/prometheus/:/prometheus/
@NotSoSuper
NotSoSuper / numbers.txt
Last active October 29, 2024 05:00
almost all the police numbers in the U.S (to blacklist from calling services) prefix: +1
423-279-3200
440-564-7014
845-677-7300
904-266-4468
315-393-1555
918-423-5858
440-293-4555
701-577-1212
765-584-6891
863-291-5200
@NotSoSuper
NotSoSuper / numbers.txt
Created January 2, 2018 03:45
almost all the police numbers in the U.S (to blacklist from calling services)
423-279-3200
440-564-7014
845-677-7300
904-266-4468
315-393-1555
918-423-5858
440-293-4555
701-577-1212
765-584-6891
863-291-5200
@commands.command(pass_context=True)
@commands.cooldown(2, 5, commands.BucketType.server)
@checks.bot_has_perm(add_reactions=True)
async def react(self, ctx, *, txt:str):
msg = None
channel = ctx.message.channel
for c in ctx.message.channel_mentions:
channel = c
txt = txt.replace(c.mention, '')
if not channel.is_private:
local function getMyself(serverConnectionHandlerID)
-- Get Self ID
local myClientID, error = ts3.getClientID(serverConnectionHandlerID)
if error ~= ts3errors.ERROR_ok then
print("Error getting own client ID: " .. error)
return
end
if myClientID == 0 then
ts3.printMessageToCurrentTab("Not connected")
return
import os
cows = os.listdir('/usr/share/cowsay/cows')
base = r"""
@commands.command(aliases=['{0}'])
async def {1}say(self, *, txt:str):
msg = await self.do_cowsay(txt, '{0}')
await self.bot.say("```\n"+msg[:1992]+"```")
"""
def do_gmagik(self, ctx, gif):
try:
try:
gif = PIL.Image.open(gif)
except:
return '\N{WARNING SIGN} Invalid Gif.'
if gif.size >= (3000, 3000):
return '\N{WARNING SIGN} `GIF resolution exceeds maximum >= (3000, 3000).`'
elif gif.n_frames > 150 and ctx.message.author.id != self.bot.owner.id:
return "\N{WARNING SIGN} `GIF has too many frames (> 150 Frames).`"
from lxml import etree
#http://stackoverflow.com/a/34084933
def get_deep_text(element):
try:
text = element.text or ''
for subelement in element:
text += get_deep_text(subelement)
text += element.tail or ''
return text
@NotSoSuper
NotSoSuper / funcs.py
Created December 1, 2016 20:22
some utility functions for discord bots
import asyncio
import discord
import aiohttp
import re
import aiohttp
import random
import sys
import os
import aiosocks
import time
@NotSoSuper
NotSoSuper / react.py
Created November 5, 2016 01:16
react command
@commands.command(pass_context=True)
@commands.cooldown(1, 5)
async def react(self, ctx, *, txt:str):
msg = None
for s in txt.split():
if s.isdigit():
if len(s) > 10:
msg = await self.bot.get_message(ctx.message.channel, s)
txt = txt.replace(s, '')
break